Are you 100% sure you got all your document and forms in order? Did you missed any forms to fill? Forgot to fill certain sections? Wrong sized photo? Some of the officers may be pissed they have to pick up your oversight (if indeed that is the case). Or more likely he is pissed that you applied so close to the expiration date (according to him anyway-which may mean more work for him).
Anyway, if, as you say, you were polite to him and everything you supply to the officer was in order, then he should not have treated you poorly. Of course, I guess there may also be an issue of cultural misunderstanding. You may simply have misunderstood his actions as rude when that is just the way he acts. But you said the other guy was polite and professional, so it is likely something wrong with that guy.
For complaints, first step is to contact the immigration department and state your case, as mentioned by Rob2020:
http://www.immd.gov.hk/en/contact-us.html
If that avenue does not provide a satisfactory answer, you can contact the ombudsman:
http://www.ombudsman.hk/how_to_complain.shtml#lodging