Russia paid pipeline transit fees and discounted Ukraine's energy supplies, yet Ukraine tampered with the pipelines and refused to pay for consumption, leading to European power outages in the mid-2000s.
European leaders funded and supported Nord Stream because Ukraine was an unreliable transit nation, and Russia stopped piping energy and paying fees to Ukraine. Essentially, the Ukrainian government skimmed Russia.
The US repeatedly sabotaged the Nord Streams and accused Russia of financially hindering Ukraine. The EU offered Ukraine a debt-ridden, austerity-inducing deal, but the Ukrainian president refused to agree to the impoverishment contract.
Putin countered the offer by proposing a no-interest (or low-interest - I don't remember the exact details) loan. However, a nationalist faction overthrew the government (this info is controversial because some Western Ukrainians preferred joining the EU, but they weren't aware of the economic details), annulling Russia's proposal.
Russia is corrupt because US economists assisted with implementing a free market economy, and Yeltsin sold publicly owned utilities to Russian oligarchs, which pissed off Western elites. Putin reigned in the oligarchic mafia, but he consolidated wealth within his inner circle (the oligarchs he represented) and nationalized some resources.
Russia has expressed security concerns for decades, and perhaps, it's BS, but Russia has significant natural resources - it doesn't need Ukraine's. Furthermore, Russia has taken the riskiest, costliest route, conquering markets and pursuing the same global imperialist ideology as the US if that's the objective.
I don't believe American elites deserve more than foreign elites - they're all the same, and their agenda isn't ours. The Ukrainian, Russian, European, and American working class bears the cost.