"Privilege" in the context of the law refers to the special relationships that a person might have which allows them immunity from having to disclose what that person said to the other in that relationship. A common privilege you may have heard of is the doctor-patient privilege, where anything that a person says to their doctor for the purposes of medical treatment is privileged; that is to say, whatever the person tells their doctor is confidential, and nobody can force the doctor to disclose what was said to him or her except under extremely narrow circumstances.
This privilege was created at least in part for the general welfare of the public; a person's ability to trust in their doctor includes the assurance that no matter how embarrassing, a patient can tell the doctor exactly what is wrong and how it got that way so that the doctor can do their absolute best to treat the patient by having the most accurate information from their patient.