He got invaded because of his own political naivety.
Zelensky's first official trip abroad as president was to Brussels in June 2019, where he met with EU and NATO officials. After that, despite his campaign promises to fix relationship with Russia, he never personally met Putin officially. (The only time he met Putin, in an official capacity, was in 2019, with French President Macron and German Chancellor Merkel). As Ukraine's President Poroshenko confirmed publicly, on the advise of the western leaders, he had decided to not implement the Minsk treaties they signed with Russia. Instead, they began to train their military with NATO forces ( https://politics.stackexchange.com/a/77161 ). It is clear that Zelensky too was convinced by NATO and EU officials to do the same as he began to look for a military solution to repressing and dominating the East Ukrainians. In the end, EU and NATO got what they wanted - a proxy war with Russia, using Ukraine.*