Putin could have had Ukraine on a platter, if he'd just slow-rolled cultural and political integrationism
That contest was already lost after the 2013/2014 revolution. Russia is a dying empire, it's a totalitarian shithole where people are jailed for the slightest wrongthink, nowhere outside Moscow or St Petersburg gets any funding, economy is shit, demographics are worse than China and freefalling into national suicide, and what little wealth there is gets pillaged by corrupt oligarchs.
It's a socially, morally and economically bankrupt state. It doesn't stand for anything. Even the Church is just an organ of state repression. Its only purpose seems to be to continue existing and escape its death spiral. That's not the same kind of visionary idealism that attracts countries to the US and EU, where even if you dislike them, they DO stand for things many people want - freedom, democracy, prosperity etc.
And yeah I know the West is hypocritical, muh Iraq muh troons muh blablabla - doesn't matter. The branding is on point. The results are self-evident. Westerners are rich, shit works here, people aren't perpetually afraid of being arrested for fuck all. That's what people in other countries see and that appeals far more to them than muh based dictator who doesn't like ze gays.
Ukraine doesn't want to be another Belarus. They don't want to be a mindless organ transplanted onto a rotting corpse. They DO want what we have in the West. The money, the stability, the freedoms. The right to look down on shithole countries and feel better than them. The shit we take for granted. That's why they drove their Russian puppet out of power and vote for pro-Western leaders.
They've made up their minds, they want to be a Western country. So that card was off the table; the only card left for Putin was force, violence. It was invade and force Ukraine to submit, or accept the inevitable permanent loss of that country. Russia historically is not squeamish about using bloodshed to impose their control where it's not wanted. Just look at Chechnya 20 years ago.
I don't think Putin was necessarily dumb for invading. I do think he was horrendously let down by the system he'd created, which has gutted the nation of any competent institutions including the military. They were woefully unprepared for such a huge operation.