It's called burning bridges. Both domestically and internationally. It signals that Russia is committed to seeing the war through regardless of what the West does and it consolidates power domestically by discouraging any potential conspirators from acting against Putin since destroying the pipelines makes it virtually impossible for any replacement to resume delivery of gas to Europe