Childish writing is the least of the vices of the Potter books. Back when Hong Kong first caught the Potter craze, and schools were prescribing the books to their students, I browsed the first six chapters of the first book out of curiosity. The book was way below my expectation. It is written in a very mean spirit: Rowling does not so much depict her characters as vilify them, using descriptions that read like slurs: pig, rat, beach-ball with bonnet. There is a heated, almost personal quality about Rowling's mudsling, and I won't be surprised that the characters were based on real-life people that Rowling did not see eye to eye with. The characters' actions are startlingly irrational and unmotivated -- a top manager in a hardware firm throwing a hissy fit over a letter that his nephew receives? Very funny for sure, but if you care to invest your time and money on a book, you deserve something better.
I can venture some reasons why the Potter books caught on: the insistence on blood purity is a very British obsession: pure-blood wizards, powerful and noble, are top dogs; non-magical "muggles" are dumb, unimaginative, irrational, a waste of your time; half-breeds, objects of derision, tend to overcompensate and become arch-villains. This is a classical reflection of the British colonial mind-set, rarely having an outlet in these "politically correct" days.
British prejudices do not travel far, so publisher of the Potter books needs another trick to sell the book overseas: they package Rowling as an embodiment of the "American Dream": single parent, female, out of job, penniless, gaining success and recognition through her vision and her perseverance: everyday she would put her dreams on paper, in the romantic setting of a dinky cafe (while most broke and jobless people stay at home and drink instant coffee) -- so, stay true to your dream, and one day you'll make it. It is hard to concoct a better sales pitch.