Huh?
These two countries heavily censor the internet.
Things like morality and ethics don't play a part in what these big corporations do. There's only profit and loss. If it's illegal, but they will make more than they lose in fines, they'll take the profit. If it's legal, but loses them money, they won't do it.
They're in Russia because it makes them money. If it didn't make them money, they wouldn't be there. This is the framework our society has created within which corporations operate. We could do better, but probably won't, because fixing things like this require time, resources, and coordinating dozens or even hundreds of competing incentives and thousands of relevant actors.
You can stop using Google products. You can advocate for others to do so. More than that is probably not the most effective use of your time. Besides, in ten years, Google might not be around - they've been notoriously unreliable for anything other than gmail, youtube, and search, and have recently dropped the ball, and to me, look like has-been hacks in the AI space.
Honestly, it's probably a good thing for YouTube to be available in Russia. It allows for western media to be seen by their population. If Russians only had access to Russian and Chinese media, the propaganda machine would be much stronger.
Now I'm not saying Google is a charity. They are probably also making money, but there's a non-zero chance someone thought about not cutting them off for non-monetary reasons.
For example, ExonnMobile isn't traditionally known as a company that abandons major profits to virtue signal and yet they abandoned their Russian operators.