This issue has plagued food writers for decades, especially because there is one dictionary-approved spelling and one that is used by a popular chain. A doughnut gets its name because it is a combination of the words dough and nut. It is literally a nut (ball) of dough
The shortened donut spelling came into popular usage about 1900 and is used mostly in the US, but gaining popularity around the English speaking world. Writers outside the US still favor doughnut. Donut appears about a third of the time in published US writing.
Think of donut as a cousin of the words lite and tonite. They are supposed to be spelled light and tonight, but marketers and advertisers choose otherwise.