Why do bikes have their drivetrains on the right?
Because (most) people are right handed.

Right side drivetrains are rooted in the fact that rotating clockwise causes bolts, etc. to tighten—this dates back to the first "safety bicycles" introduced in the 19th century. With the drivetrain on the right, more (standard threaded) parts will be rotating clockwise and thus tightening themselves as the rider pedals. 

Drivetrains are on the right today because that's what bicycle builders decided to do in the late 1800s. As to why they originally decided to put drivetrains on the right, it's probably because rear cogs used to be screwed on (some still are). Standard threads dictate rear cogs be on the right, so that pedaling force tightens the cogs. (If they were on the left, pedaling force would likely loosen cogs.)

Today, left-hand drivetrains are possible, but more difficult to create because more reverse-threaded parts are needed. Generally, things like pedals and bottom brackets have threads that are reversed/asymmetric on one side. They're made specifically to work when the drivetrain is on the right—tightening themselves as the rider pedals. If these standard parts are placed on a bicycle with a drivetrain on the left, then those same parts will be loosening themselves as the rider rides. 

But why do right-turning bolts tighten? Shortly before the safety bicycle was introduced in the 19th century, the right-turning convention was adopted because it's better to have all bolts work the same way and it's easier to turn them with your right hand. And most people are right handed.