The Oxford English Dictionary (OED) defines wardrobe as a secret room, espa bedroom.

So it seems logical that the King's wardrobe would be a closet space off the bedroom where he would dress (??). Similar to today's walk-in closet.