Why is there no neutral in a switch box?
Up until just a few years ago, the neutral was not required at a switch location.

A standard switch loop consisted of the hot feed to the switch, the switched return leg, and a ground wire. With non-metallic cable you have a black wire, a white wire, and a bare wire for ground. The National Electrical Code requires that the feed to the switch be the white wire re-identified as any other color but white or gray. So, with cable, you would then have a black wire, another black wire (a white wire with black tape on it since that is what the electrician carries all the time), and the bare ground wire.

If you had conduit running to the switch box then they would just pull two black wires for the switch loop, and a green for ground.

The Code now requires a neutral at most switch locations which is usually a white wire but could also be gray. This was not the case when your wiring was installed and is still not required if the installation uses conduit.

So, your switch box most likely had one black for a hot feed, another black for return to a load (fan, light etc.), and a red for return to aother load. And of course the green ground wire.

It will work the way you have it but one of the wires is extra.

Good luck!