The Space Shuttle "rolls over" onto it's back to reach orbit for almost
the same reason an airplane turns after leaving the runway. That is, in
order to turn into the direction it wishes to go.

While an airplane does not "roll over" like the Space Shuttle, airplanes
don't travel above the atmosphere! In going from 0 to 17,500 miles per hour
in just 8 minutes, the "vector of thrust" (the direction that the rocket
engines push) must go from the rocket engines (at the bottom of the
orbiter), through the center of gravity of the entire Space Transportation
System (Orbiter, External Tank, and Solid Rocket Boosters). This means that
the engines need to be "underneath" the Shuttle as it blasts through the
atmosphere, overcoming the Earth's gravity, until it gets to orbit, where
gravity doesn't mean as much any more. In the process of "going uphill"
(as the astronauts call it), the crew is pretty much "upside-down" in
their seats! However, with 3 G's (three gravities) of
acceleration of the launch pushing them into their seats they hardly
notice the 1 G of force in the "wrong" direction on their way "up" to orbit.