Jesus knows human nature so well. He gives a simple comparison, when "we played pipes for you, you wouldn't dance. When we played sad songs, you wouldn't cry." And then he says we are like children while doing this.
What is Jesus getting at?
When things are good we don't need God so we don't dance in joy. When things are bad we become stubborn and won't ask God for help or we blame him. It seems that God can't win.
We behave like children, wanting everything our own way and not looking to God in a mature manner; thanking him when all is good and asking him for help when we are getting it tough.
People want God to do as they want. That's a childish, silly idea of God. An adult realizes the sovereignty of God and has faith that God wants only our good. An adult then has a childlike trust in God as one who cares and provides for us.