OK. I fixed it.
The gas valve had some debris in it, which apparently, prevented the valve from opening fully when the button was pushed. That made it harder for the magnet (is the valve really held magnetically by the thermocouple current?) to hold the valve open. That, in combination with a weak thermocouple could not keep the valve open. I replaced the thermocouple and things got better, the valve was holding but only some of the time. Once I cleaned the debris from the valve, then it held every time.