The situation regarding Ukraine's security is complicated and needs to be viewed from a long-term perspective. The annexation of Crimea came after Ukraine sought an association agreement with the European Union, and Russia reacted when it became apparent Ukraine was moving away from their influence.
The annexation of Crimea by Russia came after Ukraine sought an association agreement with the European Union, not with NATO at that particular point, leading to Vladimir Putin citing security concerns about the expansion of NATO as a reason to invade.
As tensions rose between Russia and Ukraine, there were accusations coming out of Moscow that Ukraine was attempting to make a dirty bomb using its nuclear weapons, causing pressure from nationalist elements to bring Ukraine back into the fold.