I have checked and it would not appear to be against code everywhere, as I originally assumed. Sorry. In Illinois for example it appears to be allowed.
But I maintain that it is dumb to have two shut-offs on a WH. If you the plumber have put a ball valve on the hot you have opened the door for human nature to injure someone.
They possibly would not want to call a plumber when the T+P is working properly and releasing water.
They put a cap on the T+P "I can fix this honey"...
The heater builds up excessive pressure and pinholes a weld on the tank...
They close both valves and know it is now time to call you to replace the heater...
You pull up to a house with a bunch of emergency vehicles in front of it because the homeowner never turned off the gas,"It wasn't what was leaking"
With hot open maybe they will have a chance blowing a water supply.
Yes, there might be exceptions. From my 365+ days of plumbing experience as a fully qualified and master homeowner, I would guess that on a residential 2 heater parallel installation, installing a hot and cold on each heater might be essential. When 1 heater takes a dump, that heater can be isolated, and the other heater will work without the leaker leaking.
But I maintain that traditionally a 1 tank residential heater will only have a cold water valve.
A tankless might require both a cold and hot shut off with bypass valves to allow for flushing though.