Its 1.5% of Gnar's health, not yours. So, on top of already being half as strong for ranged champions, its extra less effective because ranged champions (especially mini-Gnar) have lower base health. Also, if it were melee-only (which would be hard to implement for a mastery), Gnar, the only ranged champion who uses Grasp, would still be able to take it, because hybrid melee/ranged champions are able to use things that are melee or ranged only. (ignore that)
Making a mastery melee-only the way items are would be hard to implement with the current system, so the only way would to make it just have no effect at all for ranged champions, which means that your Caitlyn who accidentally took the wrong masteries is even more useless than before. That's not a change that needs to happen when the only ranged champion in the game who consistenly takes Grasp is Gnar.