A specimen of that ruin which came down upon Israel at last, for misusing God’s prophets, and of which this was intended to give them fair warning. Elisha heard their taunts, a good while, with patience; but at length the fire of holy zeal for God was kindled in his breast by the continued provocation, and he turned and looked upon them, to try if a grave and severe look would put them out of countenance and oblige them to retire, to see if he could discern in their faces any marks of ingenuousness; but they were not ashamed, neither could they blush; and therefore he cursed them in the name of the Lord, both imprecated and denounced the following judgment, not in personal revenge for the indignity done to himself, but as the mouth of divine justice to punish the dishonour done to God. His summons was immediately obeyed. Two she-bears (bears perhaps robbed of their whelps) came out of an adjacent wood, and presently killed forty-two children,
v. 24. Now in this, (1.) The prophet must be justified, for he did it by divine impulse. Had the curse come from any bad principle God would not have said Amento it. We may think it would have been better to have called for two rods for the correction of these children than two bears for the destruction of them. But Elisha knew, by the Spirit, the bad character of these children. He knew what a generation of vipers those were, and what mischievous enemies they would be to God’s prophets if they should live to be men, who began so early to be abusive to them. He intended hereby to punish the parents and to make them afraid of God’s judgments. (2.) God must be glorified as a righteous God, that hates sin, and will reckon for it, even in little children. Let the wicked wretched brood make our flesh tremble for fear of God. Let little children be afraid of speaking wicked words, for God notices what they say.
http://www.biblestudytools.com/commentaries/matthew-henry-complete/2-kings/2.html