It's a way of criticizing something in a humorous way.
Jim and Huck discuss King Solomon satirically, criticizing and stimulating humor. This provokes the reader's reflection, making him think about the subject more lightly and understand the ridiculed subject in a light way.
It's an inhuman task to make all of these decisions correctly. That doesn't mean we should stop trying to do our best, to make the right decisions whenever possible.