Yes, it definately seems to be a morality teaching in that the 'Hell Realms' are interpreted as a very scary place that we actually go to if we behave badly.
Kamma can also function like that for some, it seems, but that's probably a topic for a different thread.