Impiety in ancient civilizations was a civic concern, rather than solely religious (as religions were tied into the state).
It was believed that impious actions such as disrespect towards sacred objects or priests could bring down the wrath of the gods.
Most famously, the philosopher Socrates was executed for impiety (as well as corrupting Athenian youth) in 399 BC.
An Athenian philosopher Anaxagoras taught that the sun and the stars were fiery stones whose heat we did not feel because of their distance, and was allegedly accused of impiety in Athens.
Diagoras of Melos was reportedly accused of atheism and had to flee Athens after being charged with impiety for revealing the content of the Eleusinian mysteries to the uninitiated.