Or did they just confess to that in the hope they'd be released? How much, if any, of their confession was true?
There are three broad theories about the confessions of certain Templars obtained by Louis Philip IV:
The confessions were extracted by putting words into the mouths of the leaders of the tortured, or confessions were otherwise falsely recorded.
The basis of some confessions were found in actual acts but manipulated to the required ends of blasphemy and heresy accusations. Some scholars have suggested for example that accounts of 'blaspheming' of Christ were actually tests of loyalty within the order and not actual blasphemy, devil-worshipping, etc.
The Templars were in fact blasphemers, heretics and devil worshippers.
Historians work with the first and second theories and argue back and forth through evidence about it. What is important and fascinating is how these stories found root in soil so fast. This after all was the century of persecution of heretics, of the decline from the heights of Papal power in the previous centuries, and the beginning period of the formation of an idea of the witch as devil-worshipping, anti-Christian cult. The accusations against the Templars were becoming common tropes.
The third theory is an utterly compelling but untenable fiction, ultimately fit only for /r/conspiracy.
edit: some French king or other
idjet has most of it covered, but I'll add a few quick points as well.
After the Templars were arrested and many brothers had already been "investigated", Clement V sent some Cardinals to look into the matter. Clement V wanted the Templar leadership especially to come to the Vatican Potiers and answer these allegations, but apparently they weren't well enough to travel. The cardinals did their inquisition and their findings were sent to Clement V in a letter known as the Chinon Parchment. This basically absolved the leaders and those who the Cardinals had directly questioned of any wrongdoing.
Why a significant number of Templars were not fit to ride to the pope to answer directly is very suspect... after all, these men were knights. Some speculation is that either the interrogation techniques were too harsh, many fell sick in the dungeons, or more likely Phillipe Le Bel decided he could keep them close and control how the investigation went, and the weak pope would be less likely to put up a fight.
Most people focus on the Templar gold, but it was from estates that they drew both wealth and power. Many people would will their estates to the order and the Templars would use this for the collection of rent or farming. By 1307, the order was the 4th largest landowner in France.
Malcolm Barber is a must read, but fairly heavy. Gordon Napier's "The Rise and Fall of the Knights Templar" is a good starting point for anyone interested in the full story. Helen Nicholson has some good stuff out there too.