The Prophet salla Allahu alaihi wa sallam wanted the Muslims to deal with other Muslims based on their deeds and not on their intention as this only Allah knows.
Besides, Huthaifa, may Allah be pleased with him was with the Prophet salla Allahu alaihi wa sallam when the hypocrites wanted to attack him and he saw them with the Prophet. from this incident, he knew them.