I used to make this mistake (and still find myself doing this when tired on the heavy bag, not on the mitts or when shadowboxing), moving slightly the elbow diagonally to my right when throwing the straight right hand. If your punching technique is perfect and you still have this problem than It is caused because of 2 reasons: TURNING THE SHOT (try throw it with a vertical fist - your elbow is naturally straight or down as you said) and throwing the shot from a SHORTER range (you'll feel at first like your going to injure your elbow if you throw it straight across at a shorter distance).
I am not saying don't turn your shot and don't throw it from shorter range. Its just VERY HARD to do it with resistance on the heavybag. IMO Roach is right when he says the bag is more for hooks n uppercuts.

In a late clip of Dereck Chisora on the heavybag i saw him flaring out the elbow on the straight right. Other fighters on the bag do it too, its a common mistake that destroys the punch and loses its punching power. There is probably a reason we don't see many straight right KO's lately.