In many Medieval societies, the king ruled by 'popularity': the king had to bind his nobles to him by gift-giving and favors, and his power was often directly related to his personal popularity amongst the nobles. This way, the nobles being at court with the king was a way for both sides to strengthen a bond. On the other hand, a powerful noble staying away from court too long could be considered as a srious threat to the kings power, and could be quite a problem: if the king summoned this noble and the noble refused, the king had to find a way of making him. If the king could not make him (by force if necessary), the ploitical position of the king would be seriously damaged.
In a later age, during the reign of Louis XIV for example, making it compulsory for noblemen to stay a certain period at court each year served a similar function in an even more direct way: staying at court was expensive, as the noblemen had to buy their supplies locally, and had to invest heavily in expensive clothing etc. This served to keep them 'poor', which for a king in constant need of money was vital.
There is nothing more dangerous for a king than an underling with more money and thus power than oneself, as happened when the Dukes of Burgundy became too powerful in the 14th century.