The record writer seemed to indicate that Michal's childlessness was definitely related to her criticism of David's worship of the Lord. It doesn't spell out that God judged her for her words, and I would like to say why I think He did not do that.
This is the important point in the whole matter, Michal did not just criticize David, but she criticized 'the worship of the Lord', and made 'this also' appear small and loathsome by how she worded things.
Consider another possibility to God Himself judging her. David had found favour with God, and was being blessed by Him in all ways. To remove the joy of having children from David himself, because of Michal's words, doesn't fall into the pattern we have of God blessing David 'in all he set his hand to do'.
I would like to suggest the possibility that David, because of his heart for God, because of his love for Him, may have no longer had sexual relations with Michal after her critical words, to honour the Lord, because her words were also 'against the Lord', when they went against David's worship of the Lord.
Her words went against the worship the Lord rightly deserved, and David wholeheartedly gave Him.
The following is additional information I would like to add, after the voting, but it is in keeping with the Biblical record.
Michal sinned against her husband and against the Lord. The sinning against the Lord was in multiple ways;
a) God established the husband's authority over the wife, as in the Genesis account, where God Himself explained to Eve and women after her how the fall would contain things that their former Blessed state did not. One of these repercussions was that Adam would now rule over Eve, he would have authority over her. This new rule was furthered by later scriptural instructions and examples to women of Sarah's obedience to Abraham, and her deliberate subordination of herself to him, shown in her calling him 'master', which is a term of respect and also a term meaning leader. (Sarah obeyed and accepted the God-explained new order in the husband and wife relationship, as a result of the fall)
How Michal sinned against the Lord first, was in "despising David her husband in her heart" which is complete inner disrespect and devaluing of her husband in her heart, in contradiction to God's instructions to honour and respect her husband, and to accept his rule over her. This would include inner heart as well as outer action respect. ie. Was Michal following Sarah's lead by subordinating herself and her ideas about what her husband was doing and continuing to respect him, even though it looked wrong to her? No, she wasn't, she allowed the disrespect in her inner heart to grow into actual despising.
Dictionary definition of despising: "to look down on with contempt or aversion, to regard as negligible, worthless, and distasteful, to hate."
also "Synonym Discussion of DESPISE
despise, contemn, scorn, disdain mean to regard as unworthy of one's notice or consideration. despise may suggest an emotional response ranging from strong dislike to loathing . contemn implies a vehement condemnation of a person or thing as low, vile, feeble, or ignominious . scorn implies a ready or indignant contempt . disdain implies an arrogant or supercilious aversion to what is regarded as unworthy ." 2nd quote from above citing.
Michal then further sinned against the Lord by despising her husband while her husband was in the midst of worshiping the Lord with all of his heart and might. This was a Holy thing he was doing, and an intimate thing between David and God. Michal disrespected and devalued and treated God with contempt, by despising what her husband did.
It is interesting to note that an antonym for despise, is: love. Love and respect go together, while despise and hate are similarly connected.
Another reason why I think that God did not make Michal childless is because of God's nature and character. Yes, Michal's heart and actions were deeply offensive to the Lord and to David, however, God states in scripture that" His mercy triumphs over His justice." God's heart is to be merciful, it is His character, and as He says in the NT, "Love is the greatest" 1 Corinthians 13, and it is written that "God is Love" Bible quote.
I submit that I think David withheld himself sexually from Michal, because her heart and words disrespected David's God, whom David loved with all of his heart, mind and soul, and David exercised a discipline/punishment of his wife for her heart attitude toward God and things that are given to Him, which things are Holy. David in this way, defended God's honour by punishing his wife.
This is a p.o.v. I hold to, although there is scripture that tells us that the Lord opens and shuts wombs, as in the example of what happened to all of the women in a foreign king's harem when this king mistakenly took Sarah into his harem and was preparing to have relations with her. God closed the wombs of all of the women in the harem as a warning against the king's actions, as well as giving the king a warning dream.
More evidence to support God not being responsible for Michal's childlessness is to reiterate that God would hurt David too, by making Michal childless, and this is not in keeping with God's relationship with David, whom God described as "a man after my very own heart." Bible quote.
A further point in support of David being responsible for Michal's childlessness I would like to add is, Michal's words and actions may give us a picture of what her usual heart attitude was like. Being raised a king's daughter would have given her access to all privileges in the kingdom, possibly creating a prim a dona. Perhaps this criticism of hers was the final straw, for David.