Because he thought that he was more righteous than the publican. When he was converted he abandoned his own righteousness and trusted only in the righteousness of Christ. He says that all have sinned and now come short of His expectations. The wages of sin is death. All men are equally sinful.
All men equally deserve to die in hell forever.
It is wrong for Me to judge other people when they have a misfortune. It is wrong for me to say that God is punishing them. If I do say that, it is because I think that I am better than they are. In fact, I make myself God when I become a judge of the actions of God. He says that man's only hope is in repentance.