There are a number of reasons to choose an elliptical or ovoid shape for a race track.
(1) It allows spectators the ability to view the entire competition, especially if there are raised stands.
(2) An elliptical track requires more skill than a circular track. There are varying degrees of turn, as well as "straight" segments.
(3) In some forms of racing, there are standard track lengths. (e.g. horse racing and track and field events.) Though the tracks can vary (different lengths of straightaways, etc...) the basic shape is limited to an oval, perhaps due to historical considerations.
(4) In race car driving, a number of concerns, especially for spectator safety, come into play when designing a course. The designers will bank the corners, include areas to safely leave the track, etc... So many race car tracks are not ovals but are tri-ovals, etc... Some types of car races do not use oval tracks at all, but include serpentine sections and sharp corners to test driver ability.