The valve's job is to open and close the valve ports. If the ports were always open, the fuel exploded in the combustion chamber would leave through the ports. The explosion has to be kept in the combustion chamber to push the piston down. The valves are set up to open and close at exactly the right moment. One lets the fuel mixture in and closes. After the fuel explodes and pushes the piston down, the other valve lets the exhaust out.