https://dinonline.org/2015/06/18/counting-non-observant-jews-towards-a-minyan/
Since the spies were clearly wicked people, and according to the Sages they were even heretics (claiming that Hashem did not have the power to bring the nation into the Land of Israel), it emerges that even the wicked can form an eidah.
Based on this, Rav Moshe Feinstein (Shut Iggros Moshe Vol. 1, no. 23) writes that the same condition applies to saying Kedushah with a minyan. According to many opinions, the only requirement is that the ten people should be Jewish. There are no further conditions, and even secular Jews, who have no connection to the Torah, can count towards a minyan for Kedushah if they are participating in the prayers.