MATHEW 17 14 And when they had come to the multitude, a man came to Him, kneeling down to Him and saying, 15 “Lord, have mercy on my son, for he is an epileptic and suffers severely; for he often falls into the fire and often into the water. 16 So I brought him to Your disciples, but they could not cure him.”Then Jesus answered and said, “O faithless and perverse generation, how long shall I be with you? How long shall I bear with you? Bring him here to Me.” 18 And Jesus rebuked the demon, and it came out of him; and the child was cured from that very hour.19 Then the disciples came to Jesus privately and said, “Why could we not cast it out?”20 So Jesus said to them, “Because of your unbelief; for assuredly, I say to you, if you have faith as a mustard seed, you will say to this mountain, ‘Move from here to there,’ and it will move; and nothing will be impossible for you. 21 However, this kind does not go out except by prayer and fasting.”22 Now while they were staying in Galilee, Jesus said to them, “The Son of Man is about to be betrayed into the hands of men, 23 and they will kill Him, and the third day He will be raised up.” And they were exceedingly sorrowful.

You see that this man holds the sin of unbelief in the disciples, because they were not able to heal.  And so, the Lord put to shame him for what he is accusing the disciples, said: “O faithless generation,” that is not so great a sin of weakness, your sin of unbelief being great, overcame their respective strength.  Reviling the man, the Lord rebukes all those present and all unbelievers.  Saying, “How long shall I be with you,” he indicates that he is enxious for the sufferings of the cross…How long I will live with offenders and non-believers?  “And Jesus rebuked him.”  Who?  Unbelieving.  From this it is clear that the man, being an unbeliever himself, thanks to his unbelief, made it possible for a demon to enter his son.

(St Theophylact)