Just like trolls, goblin were one of the original primitive races on Azeroth.
Being a primitive race, races like the trolls and the goblins would have created their own form of worship. For trolls, it’s the Loa; goblins, it’s not clearly explained.
Before goblins discovered technology , they had to have a way to survive. Unlike gnomes, they weren‘t born with inherit knowledge so they had to find ways to survive. This would also explain goblin hunters.
There is an actual good explanation on why goblin shaman exist:
At one point, goblin were slaves to Forest trolls at one point. They were mining kajamite and the prolonged exposure to that started making goblins smarter. My guess is that goblins started observing the trolls and their rituals and picked it up.
This explanation makes a lot of sense given the goblins history. Also keep in mind, goblin are also connected to Deathwing (aka the Earthwarder).
Until there’s an actual lore explanation, this is the one that makes the most sense.