I find it peculiar the nobody hasn't noticed the most central question so far: what is a right? If you believe that might makes right (and believe in the existance of an omnipotent god), then yes, he has the right to do whatever he wants to.

However, most people define "right" in the framework of some sort of ethic code, which means that the ability to do something (and the inability of others to stop you) has absolutely nothing to do with your "right" to do it. Of course, a strong adherent to the Christian faith also has to believe that god is the source of all ethics and such cannot do wrong, even when His actions (as in this case) violate principles that just about any sensible code of ethics would include, such as not killing people for meaningless insults, especially not children.

I pity people whose belief forces them to deal with such discrepancies; especially since I think that just writing it off as ineffable and implying that in some twisted way, greater good came from the deaths of those children, is a cop-out.

Personally, I find that the application of Occam's Razor yields the explanation that the Old Testament was simply written by priests with the sole aim of boosting their political power by intimidating people and stressing at every opportunity that respecting and obeying holy men (i.e. themselves) must have total priority over anything else.