Why?

I am trying to figure out why someone would do this.

A gas line in case that wasn’t obvious, there may have been a basement space heater at one time. That may an old time gas control valve for a space heater or coal fired converted to gas octopus, it is obviously not doing anything anymore. That is my WAG, other opinions appreciated. Possibly galvanized pipe, but may also be painted. There used to be a gravity furnace judging by the location of the return and supply vents, but house was 1959.

Not sure what you are asking but the valve looks to be a water valve.
Who cares where it once went ?

I thought it was a water valve too. But then I remembered seeing gas valves like this for old furnaces that did not have a thermostat. So I guess my real question is why a water valve, and can a water valve be used on a gas line?

It would have a stamp with WOG on it water ,gas ,oil ] however that type looks to have a packing nut around the stem which often can come loose and leak.

You always want to see the red handle kind because even the older gas shutoffs brass handle ] get stuck ] and leak ].

It is a water valve and should not be used for gas.

Like Bob says, you’d have to look on the valve for the marking. Typically water valve handles are red, and gas approved is green, like your pic.

I always recommend replacing gate valves with more dependable ball valves.

This one can be binned, it ain’t doing anything. This house was ‘special’ a very nicely finished total reno, but pretty much all wrong, from attic to foundation.

This IS a water valve which can leak gas around it’s stem and should be removed.

Almost every water valve I’ve ever seen in over 40 years of being a plumber had green handles (which means nothing)