Abū Hurairah relates that Allah’s Prophet (peace and blessings of Allah be to him) said: “A person who calls people towards doing good deeds will get the same reward as those who follow him and do good; and nothing will be diminished from the requital of the latter. Similarly, those who call the people towards vice will have the same punishment as those who follow him without any diminution in the punishment of the perpetrators.”
(Muslim)
Our deeds are either good or bad as no deed can be both good and evil. And people, in given circumstances, are tempted to do either good or bad deed. This hadith gives good tidings to a person who not only does good deeds but invites others to do so. It also warns a person against inviting his/her fellow beings to vice.
Calling people towards doing good deeds is in itself a virtuous act. It wins the pleasure of the Lord Almighty as well as provides an opportunity for the invitee for doing good deeds. Contrary to it, the act of inviting people to commit some evil is in itself a vicious act. It earns the Divine wrath as well as puts the invitee in a position that earns the Divine wrath.
God is All-Powerful. He can give reward and award punishment to whom He wills. He knows perfectly well the deeds done by His servants as well as the intention lurking behind the commission of the deed. Hence His judgement is based on human actions. He, however, can forgive whomsoever He wills.