One thing to keep in mind when thinking about the flow of air through a jet engine is the "path of least resistance" concept. When you burn the fuel in a jet engine, the air and combusted fuel expand considerably. These exhaust gases are looking for a way out of the combustion chamber.
When they "look" forward toward the compressor, what they "see" is a wall of air at something like 10 times normal atmospheric pressure moving at several hundred miles per hour. When the gases "look" back toward the end of the engine, what they "see" is a nearly clear path toward normal atmospheric pressure. The only thing in the way is the turbine fan, and that is nothing. The path of least resistance is clearly toward the back of the engine, so that's where the gases go.
That is true in any jet engine that has a compressor. A Ram jet is essentially open at both ends, so it suffers from the problem you are suggesting. It actually has to be moving through the air at a fairly good clip before it will work. There has to be enough pressure in the incoming air to make the back of the engine the obvious path of least resistance.
In WWII, Germany used pulse jets in its V-1 missiles. These missiles were known as "buzz bombs" at the time. They actually had a valve like you suggest -- at the front of the engine was a set of shutters. These shutters would open to let in a slug of air, and then close. The engine would inject fuel into this slug of air and ignite it. With the flaps shut, the exhaust gases had only one way to go. Then the flaps would open and the cycle repeated. This allowed buzz bombs to start from a standing stop (unlike a Ram jet) without having the complexity of a compressor.
Here are some interesting links: