Unlike more static wars, the Thirty Years' War basically raged all over Germany. You had the initial campaigns in Bohemia, then Christian of Anhalt in Central Germany, then Mansfeld rampages all over the Rhineland, then Denmark invades North Germany,Gustavus Adolphus hacks his way across the country, France intervenes in the west, and finally just before 1648 Maximilian breaks the Truce of Ulm and Swedish troops rampage all over Bavaria.
Religious hatred wasn't really what drove the destruction, though it had a marked effect on prolonging the war (especially at the beginning when this could still have been localized). The aim of most of the initial combatants (i.e. the ones most motivated by religious reasons) regarding conquered land was to expel the heretics or force them to convert, not to salt the land. Not even a fanatic like Ferdinand II desired some wanton destruction of Germany. Of course at the lower level it might have been different, but generals of a more mercenary bent, such as Wallenstein, didn't much care for religious leanings either.
Mercs were definitely the main reason for the widespread destruction. Most armies in the TYW had a small core of 'indigenous troops' with a lot of mercs and allied soldiers attached. In a period where generals did not really maintain sophisticated supply lines, pay for these mercs frequently went into arrears. And given that mercs were in such high demand, generals could ill-afford letting the mercs defect or mutiny... so they would turn a blind eye towards pillaging, which was seen as a way of 'supplementing' income. And some merc leaders (Mansfeld, for example) wanted a lot of income, even when they were ineffective at best.
The shifting nature of alliances in the TYW also encouraged late-TYW armies to resort to scorched-earth tactics. Saxony and Brandenburg, for example, are two examples of 'unreliable' German princes which switched from Protestant to Catholic (or more accurately, anti-HRE to pro-HRE) - though even loyal German states would go through varying phases of support. Eventually wholesale destruction - or the threat of it - would be seen as an ideal way to keep these princes in line, or at the very least knock them out of the war (which did work in the case of Saxony and Bavaria).
Then of course you have to factor in the fact that roving armies consume a lot of food, which meant that in areas of intense campaigning mass starvation of civilians would occur. The period also saw major peasant rebellions motivated by religion, such as in Upper Austria at the same time during the Bohemian Phase.
As for lessons? 18thC generals decided to abandon the use of mercs and rely more on drilled infantry whose quality was standardized and could be trusted not to run amok around the country. Supply lines became a major 18thC fetish as a result of experiences in the TYW as well. You could also see the fortifications of Vauban and Coehoorn as a reaction against the deep warfare of TYW, in that the enemy should be decisively stopped at the border before they get a chance to wreak havoc inside the country.