Most people going from St Andrews to Grantown on Spey would drive to perth then go up the A9 through Pitlochry, Aviemore etc, that's most definitely the quickest route. I don't think anyone would consider going via Aberdeen cause it's a massive detour!
If you want to go to Balmoral then go to perth first, then join the A93 up through blairgowrie, glenshee etc. Once you've visited head on over on the A939 to Grantown on spey. It is a twisty road through mountainous areas once you get up north of blairgowrie so it will take a while to drive it - I'd leave the best part of a day to do it including your visit to Balmoral.
The only qualification I'd add to the above is that I presume you're travelling some time in spring/summer/autumn? In winter the above roads can be badly affected by snow and the A939 between cockbrige and tomintoul is often closed for large parts of the winter due to this.
I'm not sure what journey planner you're using, but despite what it might say I think going via Aberdeen would take markedly longer - it's certainly a significantly greater distance overall. Additionally the two other routes are more scenic than going via Aberdeen - The A90 from Dundee to Aberdeen isn't a particularly scenic road IMO, OK you can see the sea for the last part, but apart from that..............It's also got a lot of speed cameras!