This incident in Book 23 occurs because Penelope, after all she has gone through, finds it hard to believe that it is her husband who has returned. We are told she worries that it might be some God trying to trick her, so she devises her "test" of her husband's knowledge of the bed, something that only he would have known.
It is important to identify that this scene reveals Penelope's intelligence and ability to think quickly on the spot. These are qualities that we have seen before in her strategem with the burial shroud that never quite manages to be finished. It also shows us the complete suitability of Odysseus and Penelope for each other, for both are kindred spirits, united in their ability to trick and beguile and deceive. None of the suitors could ever be a suitable replacement for Odysseus in this respect, and the same is true for Circe and the other women that Odysseus has met on his travels. The fact that their wedding bed cannot be moved is therefore highly significant: their bond and marriage is so strong that nothing can shake it.