In Parashat Chukat/Pinchas we learn of the story of Pinchas killing Zimri and Cozbi after the Halacha being revealed to him
We know from various commentators that he did this act with tremendous love for Hashem and without any personal emotions or ego. There is tremendous emphasis on his dedication of the mitzvah to Hashem and not for any personal means
I am wondering, if someone in this situation would not do it for the sake of heaven and was rather doing it for personal reasons, would it be allowed? And if it was publicly obvious that he wasn’t doing it for the sake of heaven would he get punished? Or is a mitzvah that requires no kavanah?