IMHO, Putin is looking at this from a century perspective. I.e. in a hundred years, the sanctions will be gone, Europe will be trading with Russia again, and Russia will still have the land.
It’s for the gas pipelines, but 100 year perspective. Sure.