I don’t think it’s uncommon for families to hang around court, and I never got the impression the Stokeworths were particularly egregious in doing so. Do we know for sure they actually lived at court and had done so for much more than the short time frame of the books?
In regards to them being allowed to - I think it might be connected to laws of hospitality. Cersei mentions Robert’s Estermont cousins staying at court for half a year after their marriage and him “repaying the visit,” suggesting to me a sort of lighthearted acknowledgement of them taking advantage of polite hospitality.
Additionally, the Stokeworths don’t strike me as particularly cheeky guests. Lady Tanda is said to host feasts, both for prospective husbands for Lollys and just for social purposes. I assume she is paying for these feasts and isn’t just at the Red Keep picking through the larders.
As mentioned already, nor are they particularly minor locally - the Stokeworth and Rosby lands are vital for the supply of King’s Landing.
Another thought I just had - we know some individuals have manses in King’s Landing and it could also be possible, although I can’t recall an example of it happening, for a noble family to lease out rooms in the Red Keep.