Answering "Why are you applying to our university?"-type question in the statement of purpose When applying to Masters programs, most institutions ask a "Why are you applying to our university?"-type question to be answered in the statement of purpose. 

Let's assume that one applicant is really interested in one institution because it seems to have a great program (from the educational point of view), amazing structures and research centers, one specific research group made of a few strong professors with fascinating interests which are compatible with the ones of the applicant (although not perfectly the same), prestige, and also a nice location. 


  In such a situation, what points should one keep in mind when
  answering "Why are you applying to our university?"?


Indeed, many words of praise of the institution and the faculty -- although well-deserved -- might be seen (in my opinion) by some either as "just flatteries" in some sense or as "superfluous obviousness". 


  So what is actually expected from this question? And what is its main purpose? 


For instance, is it actually  mostly a way to see if the applicant's research interests overlap with those of the faculty?
We want to know a) if you did your homework about us, much as you would for a job opportunity, and b) if you actually are a decent fit with our departmental culture as well as our academic specialties.

Not doing even the most cursory of homework (reading our website, looking at our faculty expertise, checking out a student group or two) suggests you just aren't that interested in us -- either you're flailing or you're spraying applications everywhere in sight. Neither of those suggests you will do particularly well here.

The academic matching isn't quite as critical for us (though this will vary quite a lot from department to department). In our discipline, it's quite common for learners to change niches during the program, and that's fine. We're mostly concerned about a severe mismatch, that is, you are strongly interested in something we have little or no strength in.

As for how much to say, this is where an admissions essay differs from a job cover letter. The essay is actually about you, not us! You can express sufficient and suitable interest in us in a sentence or two: "I look forward to studying X with Professor Y, who writes so well about Z" or "I appreciate your strong commitment to Q, a commitment I share and hope to expand upon" will do fine.

I'd lay off the "nice location" if I were you; it comes across as backhanded negging, as though the location were the only thing we have going for us. I won't say this would eliminate you from consideration (where I am, we really do have location going for us!), but it would raise a possibly-offended eyebrow or two. If, however, "nice location" means facilities the department has some control over or works hard to fund and maintain (such as excellent lab space or over-and-above digital capacity), that's fine to mention.