NATO's original mission ended with the Berlin Wall — there was no more Soviet bloc or Warsaw Pact to defend against — but the alliance actually expanded. NATO let in a number of newly independent Soviet republics, like Estonia, and former Warsaw Pact countries, such as Poland. This expansion of NATO really freaked out Russia, which sees it as an attempt by Western countries to encircle Russia militarily and dominate it politically. Arguably, Russia's fear of NATO admitting Ukraine is one of the causes of the crisis.
There's huge disagreement today about what NATO is for (beyond scaring Russia), or even whether it should still exist. The pro-NATO argument is that it keeps the peace in Europe and allows the West to efficiently cooperate on counter-terrorism and humanitarian military operations. The argument against NATO is that it unnecessarily inflames tension in Russia and forces the United States to spend way too much money on its military.