Take down the bedstead of the original single bed, put it on the ground, and then put it at the same height as those boards to form a widening. You can nail those boards into a solid piece and then stick the nailed boards on the wall.
Nail the single bed board and the newly nailed bed board horizontally in three places, and then cushion the empty place with fixed objects.