I was wondering if you know of any examples in myth of how the gods punished people who damaged altars or cult statues?
So sorry for being so late! I think the past months were crazy with some crazy hours and shifts and all but I hope things will go better.
Now that is a very interesting and intriguing question! Well let's see;
Not a temple exactly but it was sacred ground. The king of Thessaly Erysichthon wanted to build some sort of palace or a feasting hall and to do that he started cutting down trees from a specific grove sacred to Demeter and even started cutting down her sacred poplar tree. As punishment he was cursed with insatiable hunger which he could never satisfy no matter how much he ate or drank. I believe sources like Ovid even speak on him selling his own daughter who could shapeshift so to get more money to get food (his daughter would shapeshift again and return to him every time only to be sold again). Hyginus though mentions that indeed he damaged the temple of Ceres (Demeter) to build a roof for his house and hence he was cursed with hunger.
His end varies according to the version. Callimachus in his hymn to Demeter mentions how he ended up selling all his belongings for food and ending up a beggar in the streets, begging for scraps of food from tables. Hyginus in his work on Astronomy mentions how he was bitten eventually by a snake that became the constellation of the snake in the sky. Ovid in his Metamorphosis has a much more gruesome fate for him, making him eventually eat his own flesh and body in his hunger till pretty much nothing was left.
A famous myth of someone disrespecting sacred ground is of course Ajax the Lesser who forced himself into the temple of Athena and raped Cassandra (or forced her out of her sanctuary depending on source). In his mania to get her out he dragged her so hard that the xoanon (wooden statue) of Athena that Cassandra was desperately clinging on fell on the floor
For the disrespect of the sanctuary of Athena (and/or the rape of Cassandra within that said temple) Ajax was punished with a storm sent that drowned his fleet (in sources like Quintus Smyrnaeus during the shipwreck the Trojan women that were loaded as slaves on the ships even dragged down his men with them in the water). Ajax was saved by clinging onto a rock but when he mocked Poseidon for leaving him out, he was crushed by a wave against the rocks
In a way in the same category fits Neoptolemus and the murder of Priam (and also possibly Astyanax) when Priam was seeking asylum at the altar of Zeus. Neoptolemus killed him despite the law of gods therefore desecrating the holy ground. In a way his punishment seems to come by dying in a similar manner when Orestes by popular legend slays him at the temple of Delphi or the altar that he built for his father
The kings of the Trojan war also suffered consequences for taking the city of Troy and also potentially damaging the temples or altars in it because the gods sent strife among them and half of them wanted to stay and cleanse the place and the other half wanted to leave, hence destroying the balance they had built over the years. Also we know that a great number of them suffered either death or would suffer for the remaining of their lives with guilt and consequences. Of course examples of losing their lives would be Agamemnon, Ajax the Locrian etc while Nestor and Menelaus would forever suffer through the sadness of what happened to their loved ones and what happened at war despite the fact that came back to their homelands.
Last but not least we have an interesting account by Apollodorous in regards to Heracles and his servitude under Omphale.
Apollodorous gives us a different account for the story of the Kidnapping of the Delphic Tripod. While some sources like Hyginus place this event during the death of the children of Heracles, Apollodorous and concequently Pausanias place that event after the murder of Iphitus. During that time Heracles seemingly goes mad again and throws Iphitus off the walls. He is terrified by his actions and soon he was also plundered by illness. In desperation he rushes to Delphi to seek some sort of prophecy that would cleanse him from the murder. The priestess refused and this led Heracles in another fit of rage where he grabbed the sacred tripod and ran away saying he would return it only when the prophecy was given to him
Apollo got enraged and chased after Heracles fighting him having his sister Artemis by his side, while Heracles had Athena by his side. Zeus was forced to throw a thunderbolt and break the fight
Either way Hyginus and Apollodorous mention how his punishment for the murder and for the taking of the tripod would be to be sold for three years as a slave and serve and also pay compensation to Eurytus in Apollororous. So Hermes sold Heracles to Omphale where in some traditions Heracles spent his time dressed in women's clothing and doing women's chores while Omphale wore his lion mane and held his club.
I would guess these are some of the most prominent examples that come to the top of my head now.
getting a fever in July truly is a humbling experience
and
getting it because I confidently (full of hubris) told my mom "noo I can definitely sleep right in front of the air conditioning directly on my body" is even more humbling I must say