I built some beds and put them in a furniture stockpile.
They still sleep on the floor.
Place the beds, preferable in a room.
Make some doors, place them at the entrance to the room.
If you really want to pamper your dwarves, you can press r and turn it into a bedroom. They'll automatically assign.