Why Did God Create Man?

If God foreknew in His omniscience that we were going to fail and screw up the world anyway, why did God create Man?