Unless it's a political miscalculation by Putin's government, it isn't really in Russia's interest.
There are some temporary short-term political advantages that Russia could indeed derive from disrupting supply through the pipelines, and most of the answers here have highlighted that. But such political decisions are not made impulsively without considering all the short-term and long-term pro and cons of the political action.
There is only one very plausible long-term political advantage Russia could have got by disrupting supplies through NS1 - the hope that Germany would panic and allow the Russians to supply the gas through NS2. (It has been constructed and is ready to be operational, but Germany has refused to certify it due to the Russian invasion of Ukraine). Supplying gas through it would certainly be a political and economical strategic victory for Russia. But it is politically evident that such a move could easily backfire too. Putin is however known to take such risky political actions. (See @guntram-blohm answer for more details).
But apart from that one possible positive long-term benefit, everything else in the long-run is actually quite detrimental to Russia for the following reasons:
Economical Impact - Russia has made huge investment in creating energy infrastructure in Europe - it has spent billions of dollars constructing these pipelines and it's economy is quite dependent on selling oil and gas (they earn billions of dollars from it annually). Any competition and loss here has a big negative impact on the Russian economy.
Loss of political goodwill: Some European countries are willing to engage with Russia. But the more European countries become hostile to Russia, the more isolated they become in the current world order. This leaves less room for political and diplomatic manoeuvring in international affairs.
The current disruption allows its rivals to harm Russian interests and even gain over it (see Why does the U.S. oppose the Nord Stream 2 gas pipeline project?). Russia understands that losing EU as a client would be a huge blow for it both politically and economically - remember that Russia was, so far, the dominant source and supplier of natural gas to Europe for a long time.
In terms of "gas politics", there are two possible beneficiaries that derive long-term political and economic advantage - the United States and the EU.
How the United States stands to benefit
In January 1982, President Ronald Reagan approved a CIA plan to sabotage the economy of the Soviet Union ... including software that later triggered a huge explosion in a Siberian natural gas pipeline, according to a new memoir by a Reagan White House official ... At the time, the United States was attempting to block Western Europe from importing Soviet natural gas. - Reagan Approved Plan to Sabotage Soviets.
The war in Ukraine and blowing up the pipeline works in favour of the US as it has rightly made EU jittery about their dependence on cheap Russian gas. The US, which has always been unhappy (for both economic and political reason) with EU buying Russian gas, has now found a big foothold to capture the EU market at the expense of Russia.
And it is a fact now that the US is benefiting at the expense of Russia and EU. In fact, Europe accuses US of profiting from the war :
"The fact is, if you look at it soberly, the country that is most profiting from this war is the U.S. because they are selling more gas and at higher prices, and because they are selling more weapons," one senior official told POLITICO ... As they attempt to reduce their reliance on Russian energy, EU countries are turning to gas from the U.S. instead — but the price Europeans pay is almost four times as high as the same fuel costs in America ... French President Emmanuel Macron said high U.S. gas prices were not "friendly" and Germany's economy minister has called on Washington to show more “solidarity” and help reduce energy costs.
...The diplomat argued that a discount on gas prices could help us to "keep united our public opinions” and to negotiate with third countries on gas supplies. "It's not good, in terms of optics, to give the impression that your best ally is actually making huge profits out of your troubles," the diplomat said.
(And, as I pointed out before, they have been doing everything they can to sabotage Russia's pipelines, including the newer NordStream 2.)
How the EU stands to benefit
"We are trying to wean ourselves off Russian gas," the policymaker said. "When the time comes in 2028, 2029, 2030, and Russia decides to close us out, we can be like, 'Fine.'"
Without diversification EU has to be dependent on Russia, which isn't politically desirable due to their past conflicts and EU's alliance with the US and UK (NATO). But the problem EU faces is that Russian gas is really, really cheap. This makes it difficult for EU countries to buy gas from other sources as it would be an economically unpopular decision with their voters.
Any fix to a total, immediate split from Russia would require sacrifice across the continent — something that would be painful for European politicians who are wary of infuriating their voters.
"It takes time to build out renewables and to electrify heating and diversify fuels for heavy industry," Bordoff said. "And it takes time to build infrastructure needed to pull natural gas from world markets. Russia is still the cheapest gas into Europe. So you have to be willing to pay a premium" for more expensive liquefied natural gas.
Note that countries in the EU offer energy (gas or electricity generated with gas) to their citizens at a subsidised rate, clearly indicating how sensitive the consumer is to the price. This is a huge political hurdle to diversification as all the other sources are costlier than Russian gas, which means either the government will have to spend more on subsidy or pass on the cost to the consumer - both of which can anger voters.
The Ukraine war and the disruption of the Nord pipeline creates a political climate of fear and uncertainty with the Europeans that presents a good political opportunity to push for diversification to the public. While Russian gas still remains cheap, the current public hostility to Russia allows EU politicians to develop alternate infrastructure in the hopes that it may make gas from other sources cheaper and competitive enough to eschew Russian gas if necessary.
... The alternatives to Russian gas are complicated and will take time. Even facilities for liquefied natural gas exports to Europe need several years to expand. Gas suppliers need to build more capacity to cool it to the ultralow temperatures that allow it to be transported by specialized seagoing tankers. Europe needs to build more plants to warm the gas so that it can be sent through pipelines. Another alternative, nuclear, also has a complicated future in Europe, with long building times and some countries opposed. - E.U. will unveil a strategy to break free from Russian gas, after decades of dependence
"The fact is that U.S. LNG, if priced competitively, can play and increasing role in EU gas supply, enhancing diversification and EU energy security," the EU said in a document detailing the state of EU-U.S. LNG trade in late November ... Showing the extent of much of the EU’s reliance on Russian gas, the Commission noted that 11 member states (Bulgaria, Czech Republic, Estonia, Latvia, Hungary, Austria, Poland, Romania, Slovenia, Slovakia and Finland) imported more than 75 percent of total national imports of natural gas from Russia in 2018, largely due to their proximity to the country ... there are other reasons to increase imports from the U.S. right now, including having a diversity of supply source and pricing ... - Europe is fast-becoming a natural gas battleground for Russia and the US
Note though this doesn't mean that EU will stop buying Russian gas. They would be stupid to do so when the whole point is diversification of supply sources to reduce political pressure from one source, and to increase competition that helps in reducing prices.
Ultimately, analysts say, a partial transition from Russian energy may be all that is necessary — and a goal that is in reach. "Europe doesn’t have to completely eliminate its dependence on Russian gas. It just has to neutralize its potency as a point of leverage," Ladislaw said. "It takes a lot of work to back out a fuel like gas, and Europe has been well on its way to doing this over the last five years. It just needs to do more now." - E.U. will unveil a strategy to break free from Russian gas, after decades of dependence