There are many reasons why planes don't fly direct to their destination.
Mountains (for smaller piston aircraft)
Traffic capacity and traffic flow considerations for the ATC center
Weather along the route
Preferred airway routings
For an analogy, cars don't drive direct to their destination for the same reasons. Roads, I would venture to guess, would be ...