We should often feel ashamed of our best actions if the world could see all the motives which produced them.
I don't think you need religion.
Medieval learning was really advanced.