Why does this 7905 giving -12V output?
The 78/79xx series has OTP and OCP but not OVP. The only explanation for a good part is you have an external load that is connected to 12V.  The 7905 uses single sided regulation ie. it relies on the load to ground to pull, the internal transistor will push to Vin. (-24v here)