First off, most Canadian or American state's borders are not particularly straight. Even when it seems to be, and conversely, sometimes the border is straight but leads to odd results.
The only place you really have the large straight line International border is West of the Great Lakes.
When the straight borders were defined, there were no people living around them. No one had any idea where the lakes, mountains or forests were. So people sitting in offices found it easier to negotiate straight lines as boundaries, and let the settlers find out what was on either side of them, instead of deciding where to put the fences.
Lastly, if you look closely at the border, there is nothing straight about the Canadian-US border east of the Lake of the Woods.