He has told you what is good;
and what does the Lord require of you
but to do justice, and to love kindness,
and to walk humbly with your God?
(Micah 6:8, RSV)
The Catholic Church teaches that marriage is an intimate, exclusive, equal, loving and permanent partnership of a man and a woman, which exists for the good of the spouses and the procreation and education of children. Marriage is brought into being by the voluntary and deliberate exchange of consent of the parties. For the good of all concerned, every marriage (whether of Catholics or non-Catholics) is presumed valid until proven otherwise.
With that being said, there are certain marriages that are invalid from the start. They have the outward appearance of a marriage and are usually entered into in good faith, but because of some impediment, some defect of consent, or some problem in the form of the marriage celebration, they are never really marriages at all. If there was really no marriage, and if that fact is publicly proven, then those two parties are free to marry someone else.
The marriage nullity process is a judicial process developed over the centuries to allow people who believe that their marriage was invalid to attempt to prove that fact, all the while safeguarding the rights of both parties and upholding the dignity and indissolubility of marriage.
A declaration of nullity does not and cannot dissolve an existing marriage; rather it is an official declaration by the Church that it has been proven beyond a reasonable doubt that a given marriage was invalid from the start.
When a marriage is actually invalid, declaring the nullity of the marriage is a good and just thing.