I think Martin has an interest in the extremes of the human condition and understanding the psychologies of that. And this is where his writing most shines.
His villains are more horrifying than average, he’s exploring the extremes of psychopathy with them in various ways. Joffrey gives way to Ramsay gives way to Euron and each one is most twisted than the one before (book Euron, show Euron is a fucking cartoon character).
However he’s most impressive when investigating the effects on the victims and how they are shaped by what they experience. Theon/Reek (the Reek chapters are actual masterpieces, I’ve never read anything like them), Sansa, Arya, even Dany.
So I’d say it’s the opposite of gratuitous, but linked to extremes of the human condition which clearly interest him.
The show did overdo, particularly the sexual violence, in season 1. But it was reigned in after that and there’s plenty in the books they didn’t show (like what Ramsay actually likes to do with his wives).
Having said that though, I’m intrigued at why GOT gets all the flack when a lot of quality tv at the minute is pretty graphic.
I found the second season of line of duty harder to watch than anything in GOT. I’ve just watched a theatrical murder in Killing Eve which would put GOT to shame.
That’s before you start talking about the endless shelves of crime fiction, war movies, violent video games and historically, fairy tales, mythology of all countries, the Greek classics, the bible, Shakespeare, Elizabethan revenge tragedy. It goes on and on and on.