I don't think it's even that: I just don't think that the mindset that goes with sexually abusing/murdering a child and that that goes with considering the consequences of the act fit together in any way. Most of us wouldn't contemplate doing such a thing, mostly because it is completely repugnant to us, but - for some at least - because the thought of being caught and punished for it is intolerable. But the few - and it is only a few - who do go on to commit such deeds...well, I think they've closed off the part of their mind that would enable them to feel shame or fear at the consequences.
I don't honestly think the harshness of the punishment represents a significant deterrent for the kind of person who'd do this sort of thing - though it is there, of course, to serve other purposes, namely retribution and keeping someone like that out of society where he might do exactly the same thing again.
I find myself trying to figure out how people like this think - likewise with Stuart Hazell - and I simply can't. I am sure there must be a valid psychological explanation for the behaviours beyond "werl, they're just evil" (which seems a bit conveniently glib to me), but I don't really understand what it is. I expect someone's written a PhD thesis on it, if I could really be bothered to do some research...