1. Drill Grounds: Inside the Castle, this is the most important building to upgrade. Larger Marches means more successful fights and customization of Troop types in combat, more Troops safe inside a ruin, more Troops that may be deployed to safety if under attack. Likewise, you will not have to shield, and more resources collected at once particularly from Alliance Super Plots.
2. Wishing Well: The Wishing well is a valuable ally. Well it is a gamble, a wish could earn you x-times the base amount of resources, and has payed for entire batches (x4) of Troops, Research and Building upgrades that would have cost me resources from another source. Also, after using up your free wishes, I would recommend using Gold to earn resources up to a cost of 10 coins per wish every day, its cheap, in fact it can be quite profitable.
After these, it is quite situational as to what Building you upgrade next.
If you Troop Buildings will not offer you another Tier of Troops when upgraded, it is best to save those resources to upgrade other Buildings first especially since they are quite expensive. If a new Tier is available, priority is Infantry. Others debatable.
If you are involved in combat often, your Embassy, Hall of War, Depot and Watchtower should be high on your list of Castle Buildings to upgrade. Keep an eye on the Watchtower to see if upgrading it will offer any real benefit. Levels 15, 17, 19, 23, 25 and 27 do not offer any extra features currently and should be saved until you have spare resources.
The College is variable, if there is important research you need to do, then you would want to upgrade it. If you still have plenty of research to do at the current College level, then it can wait.
If you offer resource aid often, the Market can be important.
Upgrading Turrets to level 3 or 4 is cheap enough, other then that I have never seen them save the day, so well you should feel free to upgrade them, don’t make them a priority.
Last on your listing are the Blacksmith and Fortress, though useful, they are unlikely to be used often enough to be prioritize over the other buildings, unless you have the spare resources to put into mass producing level 3 and 4 traps.
The Fortress is a great way to use up that little bit of food you might have left over after setting up troops to train or donating to Alliance Science, 4, 7, 5 traps adds up over days and days.
The Walls should always be saved for when you are getting ready to advance Castle level, except under certain circumstances. Such as, if you just looted 12 million wood and should dump it fast. (Which you should, if you have enough resources for your most expensive upgrade, do not save it. I see level 5 castles with 8 million of each resource, and I ask myself, why? Then again, they might have kingdom jumped, but if you are a level 13 castle with 17 million wood, 12 million food and 1.2 million iron stored away, you deserve to be looted.) Or if you are a Trap nut, and need more space for Traps I suppose. Yes, the upgrade receives more hit points, but that does not make much of a difference over the current Tier.