A Leeds - Sheffield day return is not valid via Doncaster.
Unless I there is a relevant easement I don't know about, the Day Returns routed 'not via Doncaster' are indeed not valid via Doncaster. There are also more expensive fares routed 'Any Permitted' and these are valid via Doncaster as well as not via Doncaster.
I jumped on this one not realising it went via Doncaster and was pulled up on this but not excessed.
If you held a 'not via Doncaster' ticket and were travelling via Doncaster then, again, unless either the train was diverted from its planned route, or you had been given permission to use the ticket on that invalid route, or there is an easement which permits it, then it would be correct for you to be excessed to the cheapest relevant ticket. This is likely to be the Anytime Day Return routed 'Any Permitted'.
If the train is going from Sheffield - Leeds (but via Doncaster) than surely I'm starting from Sheffield and ending up at Leeds without changing. It's not my fault it goes via Doncaster and if it is not valid then how are the public going to know this?
The fact that it's a through train doesn't override the ticket's route restriction! Of course you can always excess your ticket, in terms of route or time restrictions, onboard without penalty. However, until such time as you do so, a 'not via Doncaster' ticket is unsurprisingly not valid via Doncaster, regardless of if you make the journey with one through train.
It might not be your 'fault' that the train goes via Doncaster (in the sense that you don't control the signals, points or train planning), but nevertheless you can expect to be excessed if traveling via an invalid route for your ticket. Does the display board on the platform at Sheffield not state that the train calls at Doncaster?
I would agree that there definitely could be cases where you take a train which, unbeknownst to you, goes via a route which your ticket isn't valid for - e.g. if your train went via Doncaster but didn't call there.