Why do certain aircraft's landing gear tilt up?
Pulling mostly from the answers provided here it seems that 


The torque produced by the straightening gear helps to flatten the plane out.
The main gear tilt on the B747 also provides air/ground sensing. All four main gear bogeys tilt when the aircraft is airborne, so on touchdown any systems relying on air/ground logic can activate
The gear is tilted to fit into the wheel well


You can check the link for the rest of the explanations.