Abu Hurairah (may Allah be pleased with him) relates that the Holy Messenger (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.”
This hadīth gives good tidings to one who invites people to virtue, and warns a person against inviting his fellow beings to vice. Calling people towards doing good is in itself a virtuous act. It wins the pleasure of Allah. Contrary to it, the act of inviting people to commit some evil is in itself a vicious act. It earns Divine wrath.
God is All-Powerful. He can give reward and likewise award punishment, here on earth and in the hereafter as well, to whom He wills. But this does not mean that His judgement is baseless. He knows perfectly well the deeds done by His servants as well as the intent lurking behind the commission of the deeds. Hence His judgement is based on human actions. He however can forgive whomsoever He wills.
The Holy Messenger encourages the believer to call people towards doing good deeds and forbids him to invite people to do evil because it will earn the same reward and can earn the same punishment for him as the doer.