The courses need to follow certain rules to mitigate the effect of tailwinds, slopes and things like that. That's why Boston isn't eligible for world records.
Here's the rule: "The start and finish points of a course, measured along a theoretical straight line between them, shall not be further apart than 50% of the race distance." (http://www.aims-worldrunning.org/world-records.html)