Why does NASA send rovers such as Curiosity instead of remotely building a small building on the surface of Mars?
To first answer the question ad litteram, NASA has so far successfully landed four stationary labs on Mars (Mars landing dates in parentheses):
Here are their landing sites on a map of Mars generated with Mars Orbital Data Explorer:
And in 2016, the NASA's InSight (Interior Exploration using Seismic Investigations, Geodesy and Heat Transport) lander, is planned to land on Mars on 20 September 2016. These are all stationary, non-mobile in-situ robotic laboratories.
Why use immobile landers? I touch one major point later on in my answer with troubles with rover wheels, but not all science we want to do on Mars (or anywhere else) actually requires a mobile science laboratory. So if you can avoid actuator dependency and having to use other moving parts, you could obviously build a more robust lander that would be cheaper and lighter, and also require simplified AI and power constraints to run it. Some long-term uses could be measuring environmental conditions and changes, i.e. a weather station, communications relay station, seismology, radiation and insolation experiments, deep ice / regolith drilling and sampling, prefabricated greenhouse / biodome experiments laboratory, astronomy, even to serve as a base laboratory for other mobile units, manned missions, or as a component unit to in-situ resource utilization (ISRU) processes, production and fabrication.
Now for why there aren't more of them. Perhaps this infographic can paint the clearest picture (click on the image for description and links to poster-size versions):
Yes, landing on Mars is hard, all those lines that cut at the outermost ring around Mars on the infographic depict failed missions to the red planet. Among many failures is also one of NASA's landers - Mars Polar Lander. So there's no wonder that we can see adult men shedding tears of joy in videos of the MSL Curiosity landing as it successfully touched down on August 6, 2012. Sky Crane landing of MSL was dubbed by NASA as Curiosity's Seven Minutes of Terror, and for a good reason;
Nobody ever attempted anything quite like it before. MSL was too heavy to be safely delivered to Martian surface like its lighter predecessors were, decelerated to acceptable drop-off speed using a set of drogue and main chutes and encased in a grape of airbags serving as impact attenuators and cushioning their final landing by bouncing on surface to a complete stop. For parcels heavier than, say, one metric ton, landing on Mars involves depending on far more complicated Entry, Descent and Landing (EDL) systems. One ingenious design that is currently being developed by NASA's Jet propulsion Laboratory (JPL) is the Low-Density Supersonic Decelerator (LDSD). If the quirks of this new approach to entry and descent parts of EDL can be successfully dealt with and the tech proves reliable, it would enable delivery of heavier payloads to the landing phase of EDL on Mars, but it doesn't address the landing itself.
But difficulties don't end with successful landing. For robotic missions (and there have been no other so far), Martian environment is harsh. Extremely fine grain and sharp dust due to lack of atmospheric moisture that can find its way into the narrowest of openings, corrosive perchlorate salts in its top regolith, dust storms and dust devils that can randomly cover or clean solar panels, low atmospheric pressure (~ half percent of Earth's mean sea-level pressure) that limits convective heat transfer and complicates aerobraking and parachute descent, low average temperatures and extreme diurnal temperature cycles, with temperature difference due to atmospheric pressure within tens of degrees head-to-toe, rough and unweathered, untraversed terrain that hides all kinds of nasty surprises like bursting fans of evaporating dry ice from under the regolith during Martian springs, deep pockets of sand, sand filled lava chimneys, and the list could go on and on, really.
And then there's the communication delay of a minimum of around 4 minutes in one direction, depending on proximity of Mars to Earth, but more commonly in the order of over 20 minutes for the communications round trip, that further complicates design of robotic missions and substantially lowers what we can expect from them. If I can reuse Douglas Adam's analogy with human fascination with digital wrist watches, as far as robotic autonomy is concerned, we're now roughly at the stage of being fascinated with automated house cleaners that can find their way around obstacles and plug themselves to the grid when they're running out of juice. We're not yet far enough for a base laboratory station with robotic explorers returning samples to it for analysis on another planet. These units would require autonomy (artificial intelligence) that we can't yet provide for them and each of the units would be more complicated in design than any of the currently still operational rovers on Mars (MSL and Opportunity), including future ESA's ExoMars rover and NASA's Mars 2020 rover missions.
MSL is also experiencing problems with its wheels, and Opportunity (MER-B) rover is driving backwards for years now, dragging the right front wheel along as it started drawing more electrical current than the rest of them since mid 2011. Same mitigation or driving in reverse to reduce stress, wear and tear on damaged wheels was used with the Spirit (MER-A) rover, and is now also used with MSL Curiosity rover. That's all due to the distance they managed to make through the rough terrain since they became operational. If these rovers had to double back to return samples to a stationary laboratory, the distance they'd have to traverse could double for about the same amount of science done, and their range from the base laboratory they could explore would be rather limited. Which would be a shame, since Mars still doesn't fail to surprise us on daily basis.
Mars is also quite large, with huge diversity in features, and lots of intraversible barriers surrounding them. So it would be a shame to invest in exploring a single area so much, when you can cover for the same money larger area in many different areas, and have some redundancy in place too, in case some of the units fail or something else goes wrong before even safely landing on Mars. If you have one stationary laboratory and one explorer/worker unit that depend on each other, you've just increased your chance of failure 100%, since a failure of any of the two would render the other unit obsolete. With the current Mars mission success rate statistics, nobody is willing to lower their chances from the mission planning stage onwards.
In the 1970s, NASA sent two Viking probes to Mars. Is this the 'unmovable lab' you're looking for?
The short answer is that it's easier to build a rover with all the lab-stuff on it.
Reuse of things in-space is harder than one might think. If there was one re-usable lab, it would need to be re-stocked, repaired, etc. Different rovers would need to be 'compatible' with the existing lab, hampering new development.
Not only that, but the rovers would need to travel back and forth to the lab-unit, and the rovers are slow as it is!
Re Quora Fean's comment
That's similar to how the 1997 Mars Pathfinder mission worked. The Sojourner rover didn't have a robotic arm. It also didn't have the ability to communicate with the Earth. That was the base station's job. The Pathfinder base station also carried a number of stationary experiments.
There have more lander missions to Mars than there have been rover missions. NASA has had the most rover missions, and even they have had more landers than rovers. NASA has had four lander missions (one of which failed), three rover missions, and one lander/rover mission (Pathfinder/Sojourner).
Planetary scientists have yet to identify one single location on Mars where a stationary lab or other structure makes sense. I suppose if you could make a case for many Martian years' worth of data at the same location you might sell a mission, a weather-station concept, perhaps.
As far as other permanent structures go, the only plans thus far I've seen have been to prepare for or be part of manned missions, the most interesting of which to me are in-situ resource utilization schemes sent ahead to produce consumables to support colonization.