Initially, this method of firing a pistol or machine gun had absolutely nothing to do with accuracy, gunfight tactics, concerns over jamming, or the biomechanics of absorbing recoil. The business of holding a gun sideways was thought up while John Woo was shooting his action movies. Why? It was first done to keep actors and stuntmen from getting spent brass flung into their faces. Later, people kept doing it because they thought it looked cool.

If you've seen a John Woo movie, you know the actors fire off a whole lot of blanks, and their little metal casings get burning hot. On one set, Woo discovered that the particular gun models they had purchased for the movie were spitting spent shells upward. So, to minimize the chance he'd have to suspend filming indefinitely and take Chow Yun-Fat to the emergency room with a scorched eyeball, Woo just told him and the other actors to tilt the guns sideways so the brass ejected away from them.

Chow Yun-Fat looked like sex on a stick in those movies, so others (gangstas, American filmmakers, game designers) started copying him because he was so damn cool. Pretty soon, everybody was holding guns sideways purely to look like badasses, without any regard for whether or not it served any useful purpose.

In short, there's no sensible reason to hold a gun sideways unless you're shooting a movie on a budget and your props master happens to bring you poorly-designed firearms.

Reference: John Woo's commentary track on his DVDs "Hard Boiled", "The Killer", and "A Better Tomorrow".