I was always taught to respect and cooperate with the police. Sadly, it appears that not everyone has that view.
I was too... and then you grow up and realise that a proportion of the police are not your friendly PC Plum from Balamory.
Like pps have mentioned there are sometimes valid reasons for this (their past experiences being the main one).
But I can tell you from experience when you are a lone female, woken up by two massive men in uniform after a nightshift, and the kids breakfast shit is still on the table and there is washing mid-fold on the sofa and the house is in a bit of a mess, and they can't even tell you what you were supposed to have done or when it happened or where it took place or how they know all this... and they don't have masks on... and they're not social distancing... and they're asking you if you are in the middle of decorating because your hall floor has been ripped up (I actually was!) while asking if children live here in a VERY judgmental tone, and they're telling you to control your dog, and they refuse to leave and go on just casually looking around your house...
Then you don't always react the way you "have always been taught".
Can you honestly not see that 
And this is all coming from a person with a partner in the force who wholly respects the police and hears first hand about how difficult a job they have!
There is only so much cooperation you can give when you HAVEN'T committed a crime and the officers are maintaining you did and they won't leave your house after gaining entry under false pretences.
Like I said, they're not all PC Plums and until you've been on the receiving end of it, what you've been taught doesn't matter a jot.