Pharaoh certainly was a rasha, whichever Pharaoh the story of the enslavement is about. Denying human rights to the Hebrews (and other groups too) was a crime against humanity. Turning people into serfs without rights was nothing to be proud of.
Nonetheless the Pharaohs gave Judaism a chance to prove itself. It stimulated our ancestors to hope against hope, to have faith when the future seemed black, to yearn for liberation and one day to achieve it.
It also symbolised a dimension of history, the encounter with and challenge of a sophisticated civilisation with major cultural achievements to its credit, and the discovery that integration and assimilation have their moral limits for Jews who need to learn that ethics matter as well as edifices.