Napping doesn't replenish energy as well as sleeping in a bed. --The Sims Wiki
Why would I ever want my Sims to nap instead of sleep? Was this added for realism or does it have any actual use?
(in The Sims4) Completing a nap provides a 6 hour Energized moodlet, which is one of the longer moodlets available.
it's kinda like a Power Nap when driving, you start to feel tired which impairs judgement and you could black out which is dangerous. you pull over and take a 15 minute power nap, this recover you slightly and you feel better than you did 15 minutes ago.
In terms of the game is much the same, your Sim takes a nap to reduce tiredness (the bed icon) so they don't just drop and fall asleep later on. also i think you don't get triple speed when everyone is asleep but one person is napping which means you wont miss a deadline
another way to reduce tiredness without a bed is to drink coffee however this raises the need to go to the toilet so time is lost at some point having to have your Sim go to the toilet (or urinating on the spot which has it's own disadvantages to time management).
They implanted it for both efficiency and realism.
The efficient part is played like this. You are on a community lot and you are trying to finish something, yet your sim is exhausted. Well, there is a bench over there so why not use it to raise your energy a bit so you can continue what you are doing.
The realism part is related to many aspects of life such as driving, work, school etc. I will use work and driving as an example. When you are on long trips you tend to get drowsy so you pull over and take a nice two hour power nap. With work you may have not gotten enough sleep so you might sneak a thirty-min. nap on the couch or something to replenish your energy a bit.
In The Sims 2, people sleeping in a bed who you make get out of the bed before they are fully rested can wake up cranky, resulting in them wasting a bunch of time as they are getting out of bed before they go on to do any new actions. Napping avoids this, thus it is useful when you just want to use some available time to recharge their energy level. (For example, if your sim has an hour before their car pool ride or school bus is due, they can grab a quick nap to have that hour add to their energy rather than reduce it.)