1) Many roads follow natural features in the land such as hill crests to avoid flooding.
2) Many roads follow the borders of peoples property. The property was often owned by people before the road was put in so when the government decided to put in the road they would purchase a small bit of land on the borders of two properties rather than splitting a single property up as often as they could. These properties would often use physical land features as the property line (hill crests, forest edges, creeks/rivers, etc).
3) Roads that are extremely straight are actually somewhat dangerous. It increases the chance of drivers fatigue in a phenomena known as "Highway Hypnosis". The lack of visual simulation and change of action, even minor changes such as following a curve in the road, lead to your brain somewhat shutting down and ignoring your repeat stimuli. This leads to people falling asleep and just having more accidents in general due to not paying attention.
The above contraints are incorparated during Geometric Design of Roads.
The geometric design of roads is the branch of highway engineering concerned with the positioning of the physical elements of the roadway according to standards and constraints.
Geometric roadway design can be broken into three main parts: alignment, profile, and cross-section. Combined, they provide a three-dimensional layout for a roadway.
The alignment is the route of the road, defined as a series of horizontal tangents and curves.
The profile is the vertical aspect of the road, including crest and sag curves, and the straight grade lines connecting them.
The cross section shows the position and number of vehicle and bicycle lanes and sidewalks, along with their cross slope or banking. Cross sections also show drainage features, pavement structure and other items outside the category of geometric design.