Overflow production always arises from Slavery.
I have no idea what the above two posters are talking about.
Monastery = 60
Temple = 80
If you play as a spiritual civ, temples are produced with a +100% modifier to hammers. This means they will effectively cost only 40, making them cheaper than monasteries. This should explain the OP's observations.