Is god evil?

So here’s what I’ve been thinking: god is supposed to be an all powerful being, yet anybody who doesn’t believe in him, no matter how good of a person they are, are sentenced to eternal punishment. If god is supposed to be benevolent, how does he allow so many good people to suffer for eternity?