OK on RV's WHITE is almost always Ground(neg).
So, on a Atwood LP only with electronic ignition
Green Is Ground
BLUE goes to the inside switch and is the wire that turns on the Red light that indicates failure of lighting
BROWN come from the wall switch, so Brown and RED should be the same wire.
The 12 volts going to the water heater is supplied AT the inside wall switch. So, on the back of the wall switch you should have that Brown which will have 12 volts WHEN the inside switch is turned on. There should be 4 wires at the back of the wall switch. BLUE which goes to the Water Heater. Brown which goes to the water heater. Then the WHITE which supplies ground for the wall switch light and then goes down to the Water Heater.
Regardless, IF the Water Heater lights, It has 2 tstats(140 degree and at 180 ECO) that will kill power to the control board to turn it off when temp is reached or fails to shut down from first tstat. Miswiring the wiring, it should NOT have ignited and if it did, then the wiring is probably correct. What makes you think the tstat is not shutting off the burner? Is it shooting water out the pressure valve? Doug