Why? Why did He create hell?
Because humans are created in His image and likeness and if they possessed unlimited freedom and knowledge they would be Gods.
Why did He create hell?
Biblical imagery tells us He created a "lake of fire" (actually burning "sulphur") somewhere in the universe for the devil and his angels. Of course, this is just imagery and not feal fire or sulphur. It is something eternal.
Worth mentioning is that the OT mentions no such thing. That is a latter-day innovation/devlopment/revelation, whatever. At any rate, it's supposed to be scary, not necessarily a documentary fact. It shows that life without God, or in rebellion with God, is "hell" (no pun intended). :)