Not for free. It costs money, time, knowledge and XP and feats in some editions. A well designed adventure will not let casters have all the time in the world to abuse this feature. It will also not let mages use teleport all the time as they will not get to rest as much as they want.
This, sadly, doesn't usually work out in practice and limits your scenario opportunities if taken to an extreme. If your adventure is about time-sensitive quests and pressure and wandering monsters whenever you sleep outside of an inn, the PCs may, indeed, feel like they need to speed it up. Or they may not - failing a quest is not necessarily the end of the world (especially if you're not playing on high levels yet) and the players might feel proceeding without their full resources will mean death, no matter what. And, of course, there are scenarios where many forms of placing time pressure is arbitrary. Players excavating unholy ground in search for ancient artifacts in some Far Away Land may have to deal with plenty of wandering monster encounters, but otherwise nothing really limits them and they can plan out the excavation themselves.
Not to mention that no matter what you do, all classes want downtime at some point, even if only for RP purposes, unless you're just playing a massive chain of ganks and dungeon crawls that never stops and never ends. But yeah, if you don't ever have downtime, you can't spend ill-gotten gains on new weapons or items. And since D&D is a game where the players are expected to get a certain amount of wealth per level, you can assume that while the fighters get hurty beatsticks, wizards find scrolls and other items. If a wizard really critically needs Knock at-will in this adventure, he will probably wager crafting the wand is worth it. If you don't put a ton of closed doors in front of him, he probably won't think it necessary. But yeah, by natural progression, wizard will also receive class-appropriate items, unless, through affirmative action, you decide that wizards get jack shit - in which case they are still really, really good, but closer to less versatile, INT-based Sorcerers - who can still solve more situations than most Fighters and Rogues can.
And, at some point, a wizard's spell list is so extensive that it's really hard to truly exhaust it. Some higher level encounters can be stopped through a simple casting of grease or silent image.
And if the players are on some sorta ship or travelling cart, nothing says that the party can't travel *and* rest at the same time.
Though if you insist that the Wizard and Cleric never rest, well, neither do Fighter and Rogue, and while the Wizard probably has a few "oh shit" spells to escape a party wipe, Fighter and Rogue really do have to rely on GM handouts to even have a chance at escaping and surviving encounter number #14.