A person who chooses the path of evil deserves to be punished, but here it seems Pharaoh was restrained from using his free will, so why the punishment?
The Rambam says (Hilchot T’shuvah, chapter 6) that Pharaoh had chosen evil so often that it became a habit and brought him past the point of return.
Rav Soloveitchik says God was so annoyed with Pharaoh for what he had done, especially to children, that He made it more and more difficult for him to repent. Repentance would still have been possible; had Pharaoh found the courage to regret his past sins and do the right thing, he could have escaped punishment.
Every human being is Pharaoh in some way. We are not, God forbid, on his level of arrogance or evil, but we too can get so used to making the wrong decisions that in the end they become a habit. We can still break the bad habits we develop, but generally we don’t.
Any time we have a choice between a mitzvah and an averah, or between doing the mitzvah eagerly or reluctantly, it is a Pharaoh-like moment.
An example: “Shall I make life hard and keep to kashrut?” At first we decide to give in and say that in the circumstances a lapse will not matter. Next time the decision is easier, and eventually we give in completely. We can still come back to the kosher path, but many don’t.
There may not be a Pharaoh-like punishment from heaven, but who knows what harm we have done to ourselves spiritually and maybe physically too.