you're right, as nato was founded pretty clearly as an anti-soviet alliance, preceding the creation of the warsaw pact. the world would have been a much safer place if it had been disbanded in the 1990s following the collapse of its raison d'etre. as we all know the best way to destroy an enemy is to turn them into a friend, absent the disbanding of nato russia should have been invited to join. the history of the relationship between russia and its erstwhile opponents over past 30 years has really been one of failure, failure to draw russia in to structures which could have prevented the sort of mess we see today. for me, one of the reasons for this conflict is the united states' decision, referred to earlier in the thread, to create a strategic partnership with ukraine in the autumn of 2021
Joint Statement on the U.S.-Ukraine Strategic Partnership | The White House. that may have been a proximate cause of the war. the existence of nato, its use in afghanistan for 20 years or more, the nato intervention in bosnia-herzogovina back in the 90s, the nato campaign against the ghadaffi regime - it's not like nato was the defensive alliance it was often represented to be.
but while the western powers may have played some part in getting us where we are, so to did russia. there've been grave concerns for many years about russian expansionism and what it might mean for countries like the baltic states, not least in military circles - see eg
Dashboard. the trajectory of the putin / medvedev regimes over the past couple of decades hasn't been towards peaceful coexistence - ideas such as dugin's or zhironovsky's about a greater russia didn't help either.