Russia's security is guaranteed by nukes. Security definitely wasn't the reason why Russia has invaded Ukraine.
I am not qualified to judge the situation with Finnland, but not all neighbors are necessarily equal. Things like geography, for example, might play a role and Finnland in, Ukraine out might be more desirable than Ukraine in, Finnland out.
NATO members are NATO members, attacking them after they've joined NATO an orginisation basically created to fight Russia would mean you go to war with all NATO members.
Russia's preference methodogly of defence is creating distance. With Ukraine, NATO would have been extremely close to Moscow. Finland is further away but they're still not happy about it.
NATO expanding into that region was well known to be something that would threaten Russia, since it was founded to fight Russia, to the point Joe Biden said decades ago[1], that Russia expanding into that region would cause conflicts.
[1] https://multipolarista.com/2022/03/08/biden-nato-expansion-r...
EDIT: As a thought experiment entertain the idea of a partnership between Mexico and China where in exchange for economic support China gets a few military bases in northern Mexico, just a few thousand soldiers and tanks and maybe an airfield here or there. Take into account the recent US reaction in response to a partnership between the Solomon Islands and China [1].
[1] https://www.theguardian.com/world/2022/apr/23/us-warns-solom...