Ukraine is an artificial country with almost 400 years of history of the grafting-on of territories by various self-interested leaders.
Russia did everything possible to avoid open war with Ukraine, and acted only when Ukraine and NATO left it no alternatives.