Technically, two people can sleep in 1 hostel bed. BUT you still have to pay 2 beds, and every guest also gets 1 single bed. If you end up in the same bed because you miss your partner (or whatever), you could do this.
Make sure you do not disturb other people in the room.
In a nutshell, you cannot compare 1 bed for 2 people in a hostel to save money. That does not work. Sorry.