Spellcasting
Except for opportunity cost. They can swing a sword around, but while they do that they aren't doing anything else. So how will they afford to feed themselves?
Whereas spellcasting doesn't take much time at all. Up to an hour to prepare your spells for the day, then a few minutes at most (for almost all spells). So the opportunity cost of spellcasting is very low.
Casting a spell takes the same amount of time it takes for a trained warrior to slash his 6-foot hunk of steel five or more times.
Grab a six foot hunk of steel, and swing it five times, as if you're hitting something, and tell me you're not a little fatigued. Bonus points if you can do it in 6 seconds, and still have time to run five feet.
Just because it only takes 3-6 seconds to cast the spell doesn't mean it's effortless. Just like just because there is no penalty for swinging around a six foot hunk of steel for nearly days in a row under D&D rules. That doesn't mean it's effortless, though. That doesn't mean it's a wave of the hand. It's as mentally draining as, say, taking an exam.
Except that's not how D&D works. You just can't cast spells beyond your limit, period. You can't even try.
Right, because your brain won't let you exhaust yourself...it's like how you can't hold onto a pot that's burning you, you can't even try...your body won't let you. Casting a spell is the equivalent of sticking your hand on a stove's burner. You don't WANT to do it. And your body won't LET you do it for more than a second.
It doesn't have anything to do with your body or mind; all spellcasting does is take away your ability to cast more spells. So there's something expended there, in the amount of spells you can cast per day, but that's it.
I'd say this is too metagame to be the explanation for spellcasting. Think of what those spells represent, of why they have those limits, of what you're actually doing when you're casting the spell, and think of that as as much, if not more effort, than taking a test in 6 seconds, swinging a six foot peice of steel five times and then running five feet in the same time, or just sprinting 30 feet.
That's not effortless. That's not even close. Players may see them as just power to spend. The average NPC adept sees that as an extra 30 feet they have to sprint if they want to do it.
There's no evidence suggesting that it's effortless, that it's just a wave of the hand. In fact, if you think of why, in the world, this limit on spells per day exists, it suggests that it's considerably harder than spending the same amount of time doing anything else. Your body will let you thrust a hunk of steel more than once per day....it
won't let you cast spells more often.
they consume zero resources on the part of the spellcaster and so the spellcaster has no reason to NOT cast them. He or she gains nothing by withholding those spells.
You assume spells take no effort to cast. This is a pretty big assumption. If they take as much effort as I'm suggesting above, then there is a pretty obvious reason not to cast them. Whether they do or not seems particularly up to the campaign -- nowhere is it suggested that it's strenuous, but nowhere is it suggested that it's effortless, either. If you need a reason, there is one. If you don't need a reason, no one's trying to convince you.
In contrast to the moron who spends all day swinging his sword in pointless circles around him -- he's NOT eating, NOT killing bad guys (or good guys), NOT making friends and influencing people, NOT putting away a little for a rainy day, NOT helping out his community -- he's just obviously a mental case. Casting spells accomplishes stuff AND costs nothing. We don't have anything like that in our world.
The comparison was for effort. Only if you assume that spellcasting is as easy as wiggling your fingers does it suggest that they have no reason to use them. But then, it also suggests that they should be able to do it more often -- how many times can you wiggle your fingers each day? Why would casting a spell require any less effort that swinging a 6 foot hunk of steel within the same interval of time?
Your entire argument about this falls apart if you consider the option (not stated, but having evidence that could support it in the rules) that spells are not as easy as a wave of the hand. In that case, there is plenty of reason to not cast a spell -- it's hard work, and no one wants to do hard work when they don't have to.
If I were king, I'd ORDER everyone to learn magic. Especially if even my big cities are getting attacked by deadly creatures on a daily basis. Your society could easily take the short-term effort of getting everyone at 11 or higher Intelligence or Wisdom casting spells for the long-term benefit of having thousands upon thousands of spell-casters available throughout the kingdom. It just makes sense.
Why would you order them to learn magic when you're having trouble feeding everyone? Just because monsters are attacking you doesn't mean you don't still have a population of hundreds or thousands to feed. If one village falls, there has to be enough food for the refugees, and for the rest of the people there.