The humor is essentially dark for a cartoon and sophisticated. But at the same time, being a cartoon gives the writers more freedom than in a normal sitcom. It always pushes the line that, despite human failings, the Simpsons are really decent people.
Mankind are apt to be strongly prejudiced in favor of whatever is countenanced by antiquity, enforced by authority, and recommended by custom.