The "earned run" is a measuring tool to determine the effectiveness of a pitcher. Walks, hits, wild pitches, hit by pitch, balks, are acts caused by the pitcher and he will be held accountable for those batter/runners that get on base or advance and then cross home plate unless they ultimately score as a result of someone else's mistake. To accurately determine a pitcher's ERA, you have to reconstruct each inning as if there were no errors or passed balls in that particular inning. Understand too that a pitcher becomes just another fielder after he pitches the ball. If he commits a fielding error that results in a run scoring that would have not scored, his ERA is not penalized.
Fungo
Never argue with an idiot. They drag you down to their level, then beat you with experience.