Frederick II was not a monster. One must consider when he lived, for one. They had NO idea that keeping children in that way would mess them up psychologically, as it surely would, if they even lived, which they didn't, and they didn't know it would kill them, either.
Prisoners were deemed at the time to have given their lives to the State. ANYTHING could be done to them and often was.
My point is NOT to say that what Frederick did was totally cool so get over it. But it was not unusual given the time in which he lived. Look what was going on in other parts of the world at the the time. Execution by boiling, or flaying alive, or Heaven only knows what else.
It should also be noted that Frederick was FAR in advance of his time in many areas as well. He was the first European monarch to forbid Trial by Ordeal, for example. He also created the first State University, the University of Naples, now called the University of Naples Frederick II. It was the first university in Europe NOT run by the Church (thank God).
He was the first to create the concept of a centralised nation-state, which he did for the Kingdom of Sicily. The Liber Augustalis, also called the Constitutions of Melfi, remained the Basic Laws in Sicily all the way down to about 1818.
If those stories are true, was it cruel of him? Perhaps. But given the standards of the time, not worse than any monarch. He was also HIGHLY tolerant of Muslims and Jews in his lands. Under Frederick, either group was able to pretty much live as they wished, without fear of the State, as long as they weren't loud about it. There were no pogroms, no big men with swords knocking on the doors at night during his reign. Jews and Muslims also flourished at his court as scientists and translators of Aristotle and other Greek, Arabic, and even Hebrew learned persons.
Frederick himself was no slouch. In addition to speaking German, Italian, Latin, French, Arabic, and one other tongue (I don't recall which) he was also an avid sportsman who wrote a well received book called De Arte Venandi cum Avibus, The Art of Hunting with Birds, commonly known in English as the Art of Falconry. In it, he describes the nature and care of birds generally and birds of prey in particular, and how to hunt with the latter. His book is still in print. He challenges Aristotle frequently, and was proven right in the 19th century by bird specialists. The writer of this answer is lucky enough to own a copy.
The man was NOT perfect. Nor would he have claimed to have been. If the story about the children IS true, I expect he probably regretted their deaths, since no one knew that would occur. But these stories have circulated for CENTURIES! Are they true? Who can know at this point? There is no proof, and never will be.
Frederick was a man who inspired passions in everybody who dealt with him. Either you LOVED him or you HATED him. Very rarely were your views of him mild. Its just the way things were with him. You readers can tell I am rather fond of the man. But even I admit he could probably be quite unpleasant if you got on his bad side. We all know I mean the List where the Human Waste resides. And by unpleasant, I think we can all surmise my meaning.
Be ready for the book when it comes out. Thanks. The info I gave here is stuff you can find with just some basic research. My book will expand on that and make some very interesting claims that you should all enjoy.
EDIT: It should be noted that, although Frederick DID create the concept of the centralised nation-state, if you will, in the Kingdom of Sicily, he, quite sadly, did EXACTLY THE OPPOSITE in Germany. Frederick had spent his entire life in Palermo growing up. There he had receieved a cosmopolitan education at the hands of a multiplicity of tutors both Christian and not, and had breathed in the scent of the crossroads of Europe his entire youth. It was here that Catholic, Muslim, and Jew all met, bought, sold, traded, had sex, and did about everything else that humans can do with each other.
By the time Frederick was ready to become Holy Roman Emperor, the man was a thorough Sicilian in matters of culture from the language he normally preferred to speak to the weather he preferred and the food he liked. He had not been to Germany and had no real desire to go. He did, as he knew he had to. He went, and quickly realised that the easiest way to get the troops and money he needed to get his title was to let the recalcitrant nobles have their way in terms of their feudal rights and then some. He quickly left the country, and only went back once or twice more in his life for short periods. Otherwise he left Germany to his son Henry (and later Conrad) to control in his absence.
Now this may have been a FINE method to get money for his pocket and troops for the army. But it was disastrous for Germany! As Germany became more and more feudalised, the likelyhood of it EVER developing a centralised nation-state became slimmer and slimmer. And after the fall of the Hohenstaufen Dynasty, the idea of bringing Germany and Italy together into one Imperium fell with it. As a result, NEITHER country was able to unify until 1870 (Italy) and 1871 (Germany).
So what can be said of Frederick in the end? A brilliant man. He thought in terms of what could be done at the beginning of his rule. Although he had some grandiose ideas which I shall present in my book, I think that he was perhaps a little TOO grandiose, and not in the right way. He focused on unifying two countries into the HRE when two separate nations in personal union would have been a safer bet.
If I say anything more, then you won't have reason to buy my book, so there you are.