You need to go one step back in this question. Was it right to send humans to Mars at that point?
If you send a human spacecraft to Mars then one possibility is that it will crash. Could be because they misjudge the insertion burn. Could be that they skim the atmosphere a bit too low. Could be that any number of things go wrong during the "minutes of terror of the landing itself". It all has to happen on sequence at the right moment and far too quickly for human reactions to sort out any mistakes.
And landing previous unmanned spacecraft successfully on Mars doesn't make it safe. Even if the chance was 50/50 of success for each landing, you could easily, by chance, have three or four successful landings using the same technology that lead to a crash on the fourth or fifth landing. So, say, four prior successful landings prove nothing really.
So, if you have a crashed spacecraft, then that spreads dead humans and food and air and all the microbes inside the spacecraft over the surface of Mars. Probably time to say "goodbye" to planetary protection. Especially as the dust storms on Mars make it a connected system.
You get extremophiles in human habitats. Indeed even in unmanned spacecraft carefully cleaned. Extremophiles are microbes that can withstand extreme environments - it doesn't mean they have to live in extreme environments. For instance microbes that can withstand living in Antarctic granite cliffs, or in radiation cooling ponds, are also found on human clothes. A microbe that is associated with hydrothermal vents was found in a human belly button. A microbe that is one of the best adapted found in an experiment to look for microbes capable of surviving in Mars-like low atmospheric pressure was isolated from a human tongue.
And 99% of all microbes in any habitat generally are unknown, uncultivable. Many entire phyla are only known from DNA fragments - hardly anything known about them, the problem of microbial dark matter.
So in short, if they wanted to protect Mars from Earth microbes, they could not have sent the mission to Mars in the first place.
And to approve humans on Mars would require international consultation and approval at the highest level. Can't be done within the existing planetary protection protocols. And it would indeed potentially impact on the science done searching for life on Mars.
There are many possible habitats for life on Mars - no streams, no grass, no trees, nothing like that is likely. But life on the edge, microbes slowly metabolizing, photosynthesizing. A tiny droplet of water a few mms in diameter is like a "swimming pool" for a microbe, as Nilton Renno memorably put it.
As for whether you could keep a Mars base contained and not let any life escape from it - that seems highly dubious also. Air would probably be vented to deal with CO2 build up - even in the best of closed systems. Human wastes might well need to be disposed of. Even non functioning equipment, packing from supply vessels etc. Every time they open an airlock, then some air escapes into the atmosphere of Mars and some microbes have their chance to fall into a shadow on the ground. If protected from UV light in a shadow, they can then be imbedded in a grain of dust and then potentially be spread anywhere on the planet. Even just walking around in a spacesuit, then they leak air all the time. And what if an astronaut is injured and the spacesuit is damaged? Or there is some damage to the habitat and it leaks air?
If we could land an "inside out" biohazard containment facility with humans and all the microbes that coexist with us as the biohazard to be contained - and do that with such confidence we know it can't crash during landing - well - I don't know if that is possible - and some future spacesuits that simply don't leak air, or if they do, so filtered that not a single microbial spore can escape - will that ever be possible?
I don't know but not yet for sure.
Some say that it is possible, using examples of expeditions through the high Arctic, and doing tests to see if any microbes are detectable leaking from the expedition. But you'd have to be very sure indeed to apply those lessons to Mars. After all a microbial spore can survive for millions of years before it wakens into dormancy. It would just need one viable microbial spore of the correct species, to be imbedded in a grain of the fine Martian dust, and to be carried somewhere in a Martian dust storm - and maybe years, decades later it lands in a habitat where it can reproduce, and spread.
It will be up to astrobiologists primarily to study this carefully. But I think everyone is involved in it, because if we do introduce Earth life to Mars, then this impacts on the entire world, on all the scientists wanting to study Mars in every country. And in all the people who might be benefited by the discovery if we find present day life on Mars that was not brought there by ourselves.
Anyway in the Martian, he just skated over this topic. As is also the case for just about all science fiction stories set on Mars. Indeed I can't think of a single science fiction story or movie that realistically depicts the processes that would be needed to lead to human landings on Mars being permitted under planetary protection policies.
The obvious thing to do is to send the humans to Mars orbit instead, or to Phobos or Deimos. And study Mars indirectly by telepresence, through avatars on the surface.
It might be nice if some science fiction writers were to start to write stories with such scenarios in them, and to show rather more awareness of the need for planetary protection than the token couple of sentences or so in most science fiction - if they cover it at all.
There is lots of awareness of the need of planetary protection for robots on Mars. We all understand that they need to be sterilized, get enough news articles about this so that anyone who follows the topic is probably aware that all our rovers sent to Mars are sterilized in order to prevent them introducing Earth life to Mars.
But as soon as they start talking about humans, for some reason, all ideas of needing to protect Mars from microbes in spacecraft with humans on board is just ignored. Even sometimes in the same story or tv program they talk about need for planetary protection for robotic explorers, then go on to talk about prospects for human bases on Mars but don't mention planetary protection for humans at all. It is very rare that stories about human exploration of Mars - news stories or science fiction - draw much attention to this at all.
Yet, rather obviously, the risk to Mars from a human occupied spacecraft is far higher even than an unsterilized robotic rover, never mind the highly sterilized rovers we send there.
I actually thing that quite possibly, in the fictional universe, by the time that he landed on Mars, even before his accident, Mars was already compromised to the extent that if you found evidence of life on Mars, your first guess would be "Is this life we brought here ourselves?".
While as it is now, if you find e.g. a chiral excess of amino acids or some such, very delicate signals of life processes, then your first assumption would be that this is native Mars life, present day or ancient.
There is a chance we have contaminated Mars already though. Hopefully a very tiny one. And I think we should send missions to Mars to test for that too. Land near to one of our previous rovers, close enough to be able to go up to it and test it for presence of life brought from Earth - should find spores as we believe that they must still survive there. So look at those carefully and see if there is any sign that there is a chance they could be spread further on Mars. If so, and especially if there is any sign that has actually happened, the next question would be, "Can it be reversed"?
If we did find we have already introduced Earth life to Mars, I think the next reaction would be some shock amongst the community of astrobiologists - and also - that we should be very careful not to introduce any more life to Mars while we study the situation and see what we can do about it, if anything.
But the general view seems to be we haven't done so yet. Mainly because Mars is so harsh, and the rovers and landers were pretty well sterilized, probably well enough for such a harsh environment. But to land a human occupied craft there and to risk a crash- it's not at all clear that Mars is suffiicently inhospitable for that to be safe for planetary protection. And by far the most interesting case for astrobiology of course is if Mars does have habitats Earth life could survive in. But that's the veyr situation where we should keep humans far away until or unless we are absolutley sure it is okay to send them.
For some of the possible habitats for life on Mars, see Are There Habitats For Life On Mars? - Salty Seeps, Clear Ice Greenhouses, Ice Fumaroles, Dune Bioreactors,...
I enjoyed the Martian by the way. One of the best, most engrossing science fiction stories I've read for some time and the ingenious solutions and geeky use of bits of spacecraft etc were great fun.
But it's science fiction and you go to science fiction for inspiration and fun ideas, but not for future prediction and realistic future in every detail. Even the hardest of science fiction almost always gets quite a few things wrong. E.g. all the stories about humans not being able to communicate to Earth from the Moon before the lunar landing (because of misunderstanding by science fiction writers of how the heavyside layer works). And Arthur c. Clarke's very hard SF "Fall of Moondust" was written not long before the idea of thick drifts of dust on the Moon deep enough to bury an entire lunar cruiser "bit the dust" for good. There are many other examples. Some also of prescience and new ideas in science fiction - but they go together, even the same story may have some things that later seem absurd or just wrong, and other things that are far seeing and surprisingly accurate.
PLANETARY PROTECTION IS NOT TRAPPING US ON EARTH
This is an answer to a comment, just putting it here as others may have the same question.
It is not trapping us on Earth because Mars is not especially good for humans. It's been way over hyped as some kind of paradise second Earth. It isn't. Its cold, vacuum, no air to breath, cosmic radiation hazard so you wouldn't be able to spend much time out of doors in your spacesuit, requires pressurized spacesuit to get out of doors at all like the Moon, it's far from Earth so you can't get back in an emergency or be supplied from Earth. I don't think it is a natural next step for humans at all irrespective of the planetary protection issues.
The natural place to go is to the Moon, plus building habitats around Earth, if we want to have some humans in space. Or for exploration we could explore the entire solar system via telepresence. Humans in orbit operating avatars on the surface. That way we can explore places that are impossible for us to visit in person.
Mars is far far less habitable than Antarctica, or the sea bed. Nobody lives on the sea bed permanently, even though there is breathable air available just a few tens of meters above. The difficulty of breathing and needing breathing apparatus is enough of a disincentive.
Take away the hype about Mars, it's a place that is far far more inhospitable than the sea bed. The lack of oxygen of sea bed, combined with the lack of resources of a cold dry desert of the Atacama desert. Then also need to protect from cosmic radiation with shielding, and to build your habitats to contain tons per square meter outwards pressure. and if you ever go outside your habitat you need to wear a bulky and clumsy pressurized spacesuit - and if it is damaged, or you just forget to get back to your air supply in time, you are dead.
Astronauts doing spacewalks make it seem easy. But they are professionals highly trained and it is extremely dangerous. Only looks easy because they are so careful and disciplined. And even then, from time to time they have to abort a spacewalk because they decide it is not safe to continue. Walking on Mars would be like doing an EVA from the ISS.
It would be much safer, and more fun from orbit. Then you can control a robot via telepresence on the surface, binocular vision, haptic feedback so you can actually feel things too. And not in any risk yourself; Enhanced vision. Robot doing what it does best and humans doing what they do best.
See also:
Robert Walker's answer to How soon can humans move to and live on Mars?
Robert Walker's answer to Is Mars capable of supporting life?