Reason of revelation:
It was said that this verse was revealed because of Obada bin Assamed (may Allah be pleased with him) and Abdullah bin Obay bin Salool, for Obada stopped his allegiances with the Jews, but Abdullah kept his allegiances claiming the he feared that the disbelievers might defeat the Muslims. This divine warning was directed to the hypocrites in Medina whose faithfulness was for the Jews against the Prophet (saws), so their loyalty was to the Jews rather than to Muslims.
( إِنَّ اللَّهَ لَا يَهْدِي الْقَوْمَ الظَّالِمِينَ … ) (…Indeed, Allah guides not the wrongdoing people): Because they were wrongdoers, they were deprived from divine support, whereas the guidance is for all humans.