Though Jesus had been teaching on behavioural issues, He did so to bring condemnation upon the SelfRighteous, preparing them for the spiritual NewBirth which would enable them to manifest right behaviour.

When Jesus used the word perfect relative to the HolySpirit He condemned every person. No one listening to Him could feel justified from that point on.

Essentially, Jesus pulled the rug out from under everyone. We are none perfect through our behavior nor can we be. We need a Saviour. We need to be BornAgain. We need to be filled with the HolySpirit in order to be the children of our HeavenlyFather.