I don't think a goblin HAS to be evil. Like, I don't think it's literally baked into their DNA. But a goblin who is raised among normal goblin society is almost certainly going to be evil. If some good and kind people raised a goblin in a loving, nurturing, moral environment, they could probably be just as good as anyone else.
But the goblins we see in BG3 are absolute shitlords, even the kids.
Nah. Goblins aren't just a result of their environment on anything like that (if anything their cruel environment is a result of their cruel nature). They're not humans, there's fundamental differences in what they are and how they think.
That's not to say *all* goblins are inherently like that. But nine in ten would be. If you raised those goblins in a nurturing and moral environment all you'd get are a bunch of cruel assholes who at best have learnt that loyalty to their community is important and channel their sadism at "acceptable" targets like unimportant outsiders, beggars, animals, and the like.
The last one in ten might grow up to be a good member of a good society. But they also don't fit into goblin society. If they grew up in gobville they'd likely be shunned, or stabbed in the back, or eaten.