The king puts on the clothes of a commoner because he doesn't want to overawe the old hermit. For what seems like an absolute eternity, the king has been trying to get answers to his three questions, but all to no avail. He summons the wisest men in the kingdom to his palace, and yet they cannot give him what he seeks. Perhaps the king senses that the wise men, feeling slightly intimidated by the king's presence and all the trappings of his enormous power, are simply telling him what they think he wants to hear rather than giving him the unvarnished truth.
Going out into the world dressed in ordinary clothes is one way of getting round the problem. Bereft of all his finery and royal regalia, the king will stand before the hermit as just another man. Hopefully, this will mean that the king and the hermit will be able to speak to each other with honesty, on equal terms. The king is effectively coming down to the same level as the hermit in order to pick his brains. He knows that, as well as having a reputation for wisdom, the hermit is also a simple man, and that being the case, it's better to maintain a suitably simple demeanor when seeking his advice.