NATO didn’t agree to not expand, some ministers of some member countries verbally said that NATO wouldn’t expand. It’s not like there was a treaty that was signed and then ignored.
Well I guess that for Russia it doesn't really matter if the agreement was official. They still feel threatened by it, and they have been saying that, and NATO still went on.