The thing is, grappling or even being restrained, is not meant to prevent attacking or spellcasting. And while the DM can rule otherwise as always, he'd impose additional limitations that aren't normally suppose to occur, and to which would always prevail if there is no drawback whatsoever in doing so. I mean, why would a creature not always restrain an enemy in a manner that prevent it from attacking or spellcasting if he can just like that?
In 5E grappling, pinning or otherwise restraining impede on attacking and prevent movement, but not actions.