No, they can't. Firstly, you should complain to their local, then regional police organisation. If nothing is done, you should have an independent national body you can complain to - in the UK we have the IPCC.
Even if the attitude by them can be excused with a warning from their superiors, the points cannot and it was probably illegal/abuse of power for them to do so.
Ubuntu. Linux for human beings.
If you are interested in trying Ubuntu or Linux in general, PM me and I will answer your questions and help you install it if you wish.