I think that mucus also helps us know when we are dealing with an infection.
I had my nose pierced last month. Everything seemed to be going fine until I noticed green mucus leaking out of the piercing. I knew that green mucus is a sign of infection and I went to the doctor. My doctor prescribed me antibiotics and the infection cleared up in no time.
If there was no such thing as mucus, I would not have know that my piercing was infected until the infection had spread and gotten worse. So mucus is a good thing.