The best reasoning I've seen on the matter is this:
Countries in Europe have been pretty clear that no-one is going to back down on supporting Ukraine in order to get some cheap Russian gas. So the pipeline is useless to Putin.
However, a rival oligarch/military leader/whatever in Russia could try to cut a deal with Europe and say that they promise to kill Putin and get Russian troops out of Ukraine, in exchange for agreements to resume the gas trade and no questions asked about who the money for the gas is going to.
So the pipeline is useless to Russia as long as Putin is in charge, but it's also a threat to Putin, personally, since it can be used to fund a coup against him. Therefore, he decided to sabotage it. If you think of Putin as a paranoid mafia boss foremost, and a politician and world leader second, this explanation makes sense.