The gas valve is not receiving a signal that there is a flame or that it needs to come on. The flame should cover the end of the thermocouple. The connection to the gas valve should be snug. Sometimes it can be the Energy Cut Off at the thermocouple connection to the valve but this is unlikely.
Sometimes connections to a thermostat are hard to make or the wires have been crossed. You cannot always go by the color of the wires. They need to be compared to the connections on the gas valve.