Schools have a massive pool of teachers from which to draw when they post an opening. There are advantages and disadvantages to any choice, including cost, experience, qualifications, malleability, longevity, and personality. A school district has to weigh all these factors before making an offer. No one factor alone can determine how a teacher will perform, and what benefit (or hindrance) that teacher will provide to the students given to his or her charge. Keep this in mind, as this discussion will focus only on the qualifications, or credentials, a teacher may have.
In the American public school system, every teacher must be certified. (Temporary exceptions are made in extraordinary situations, but the general rule is there.) There are multiple routes to certification, but the traditional path is for a student to enter college and pursue certification in the teaching field they are most drawn to. This might be generalized elementary (typically grades K-6), middle school math (in the vicinity of grades 5-9), or a specialized secondary school (grades 7-12) discipline such as English or Science. The spectrum of choices is wide, and teachers can pursue multiple certifications. Coursework includes a collection of classes on teaching theory and practices, some general, some subject specific. The teacher-to-be also takes a broad survey of courses covering the subjects they will teach. This ensures that teachers possess the core knowledge that the state has mandated be passed on to the students, and a bit beyond. To gain certification, the teacher also acquires practical experience, usually spending two semesters working as a student teacher under the tutelage of a mentor. By the time the teacher is certified, they have all the basics covered; both How to teach and What to teach. Along the way, they've also picked up a Bachelor's degree, either in education or in a particular discipline (i.e. English, History, Biology...).
The certified teacher is intended to be knowledgeable and versatile, able to meet the general needs of a classroom in their chosen field. They will have the knowledge to explain the material found in the textbook, and potentially to provide supplemental learning from their own studies. This represents the "basic model" of a teacher - the minimal credentials, and lowest level of learning and experience. Over time the teacher gains in experience, and through continuing education and seminars gains a greater knowledge of subject matter and teaching strategies. In time they may elect to earn a Master's degree - a requirement to maintain certification in some states.
A Master's degree commands a degree of respect. Only a small fraction of the populace earns any type of graduate degree, and teachers make up a large portion of the fraction. For the purposes of teaching, there are two different types of Master's degrees to consider: the Master of Education, and the Master of a particular subject area.
The teacher who pursues the Master of Education studies heavily on teaching theory and practices. They may even conduct research on new teaching techniques, publishing studies that benefit the whole profession. This degree serves as an indicator of a professional who has worked to hone their skills as an educator. It does not serve to greatly increase a teacher's content knowledge in any particular subject area. This is a valuable choice for teachers of lower grades, where highly specialized subject knowledge would be of minimal benefit.
A Master's degree in a particular subject area demands advanced learning of the teacher. They complete coursework alongside other students who are seeking high level careers in that particular field. While a few courses designed specifically for teaching a particular subject may be included in the curriculum, the majority of studying is focused on gaining a deeper understanding of the material. Armed with a greater repertoire of material, this teacher becomes better able to answer higher level questions that students may ask, create a broader array of lessons than offered by the standard curriculum, and can especially benefit gifted and talented students who yearn for more stimulating and challenging material. This choice makes excellent sense for a teacher in a secondary school setting, especially in an environment that encourages students to excel.
From the outside, a non-teaching professional who already possesses a Master's in their field may choose to pursue teaching certification. Such a person then holds a great deal of subject matter knowledge, both from education and "real world" experience, and is apt to be the most versatile in providing stimulating and challenging material. In contrast, they will only have been provided the minimal theory afforded to beginning teachers, and will have to gain experience in practical classroom theory. (A teacher with a Master's degree can still benefit from further education, without a doubt.)
With this understanding, schools make their hiring decisions. Hiring a teacher with a Master's degree usually carries a higher price tag. (Most districts have a schedule that uses education and experience to assign salary. A Master's degree can add a thousand dollars or more per year.) A Master's degree also conveys credibility upon the district. One common benchmark when comparing school districts is the percentage of teachers who hold Master's degrees. The idea here (true or not) is that districts with a higher percentage of teachers with Master's degrees will have more effective schools. When competing for funding, there is an advantage to having the prestige of having Master's (or even Ph. D's) on the roster.
At the end of the day though, the most important area of impact is on the students. A teacher with a Master's degree has the potential to possess greater abilities, either in subject knowledge, teaching ability, or both. The degree itself bears no guarantee, but when the teacher makes the most of their education for the purpose of benefiting their students, the rewards are clear. Students have the opportunity to learn more, explore more, and develop a real passion for learning as they see the same passion in their highly specialized teacher.
When the budget allows for it, it is unsurprising that schools prefer to hire experienced teachers with master's degrees. It benefits the schools' reputations and offers a higher quality of education. There are downsides to this hiring practice as well. The number of experienced, Master's degreed teachers is finite, but not insignificant. This makes it difficult for newer teachers to compete in a fairly saturated market. They are frequently forced then to work for poorer districts which cannot afford the higher ticket price of a Master's degree. Poorer districts, unfortunately, are often those which could most benefit from a highly experienced teacher, and often tend to be more stressful, leading to a quick "burn-out" on the part of the inexperienced teacher, who then must be replaced - with another inexperienced teacher. In the end, this pattern contributes to social inequality, as the better education tends to go to students in districts which can better afford it.