I am copying the following from Pulie_D's answer, as it is accurate and I have nothing to add to it but without it my answer would not address both questions in OP's... uh... question.
Second, Tomahawks were shown to be flying above enemy territory before hitting the airstrip. So, why were SAM sites not able to pick them and destroy them?
Because SAM are intended for use against aircraft not other missiles. Hitting a missile with another missile is incredibly difficult if not impossible.
Onto my contribution:
Is it a plot hole?
No.
To answer that question I will first be speaking as if the United States wanted to destroy the site (which they almost certainly did) on their own instead of their allies in the region, as stated in the movie. I do this to avoid having to copy-paste "The United States' alies in the region" anytime I wish to talk about the initiator of the mission.
Second we must keep in mind the whole reason for all the parameters of the mission is, besides everything else, to avoid an international incident.
Allow me to elaborate on that:
The "proper" method for that situation would be for anyone to bring attention to the countries that signed the agreement which outlaws the enrichment facility that the enemy nation has broken.
That is a lengthy process that would take forever to even get to the point of an investigation, never mind taking action.
By the time anyone launches an official investigation the site would have been long cleared of any evidence, the machinery would have been moved or stashed and after everything clears the site would just resume operation.
TL Note: That process is appropriate for cases, such as a site that isn't active yet, is still being built or you can't launch a strike. Then you have the time plus it could be harder to hide the evidence.
Which is why the US is opting to destroy it without anyone's authorization/permission as doing that would solve the problem immediately and there wouldn't be any international consequences.
Why wouldn't there be?
The enemy nation doesn't want anyone to find out about the facility as that would start an investigation and unwelcome attention. Clearing the site before an actual investigation is tedious, would set them back and still hides risks, so it's not something to be taken lightly.
The United States don't want anyone to find out about the attack, because it is unprovoked (having an illegal facility does not a carte blanche give anyone) and illegal.
So, paradoxically (but not really) in the case the mission is a success BOTH sides would want to keep quiet about it.
- If the enemy nation were to voice a complaint that the US attacked her, the very first question asked would be "What was attacked?". Since real life isn't a video game or black and white, answering "an air strip" would not automatically satisfy that question. Of course, answering "an illegal enrichment site" would be even worse.
If they say "The US unprovoked attacked one of our air strips!" immediately they would be asked "Why would the US sail an aircraft carrier, complete with entourage, halfway around the world (it is not specified but 90% the enemy nation is far, far away from the US), exposing it to attack and diminishing their force, just to launch missiles on a random airstrip and then promptly leave without doing anything else?". Not a single person alive would buy that story. At that or any other point the US can provide proof (sh*t has already started to hit the fan, might as well pile more on top) which would cause troubles for the enemy nation.
- If the US say "The enemy nation had an illegal enrichment site." they would be asked "HAD?" or even if they are not the enemy would provide proof of an unprovoked attack and the US would be in trouble.
Just imagining the amount of paperwork gives me a migrane.
Onto the actual question.
tl;dr: Yes, Tomahawks have a ~5m accuracy and 25m blast radius so they can absolutely target the SAMs. But destroying the SAM sites would scatter dust and debris across the area, which can take up to 30 minutes or more to settle (heavily depending on weather conditions), preventing any aircraft flying there.
The time-critical aspect of the mission is primarily so enemy aircraft don't have time to intercept the strike team but also to not give the enemy time to react. The second point isn't made clear in the movie because the idea to wait 30 or more minutes for the dust to settle is unthinkable.
- First off, the vent can be covered by debris if the SAMs are hit thus rendering the mission impossible.
- Second, in the time it takes the dust to settle the enemy would have plenty of time to mobilize any units in the area, which can include mobile SAMs, self-propelled anti-aircraft guns (SPAAGs), self-propelled air defense systems (SPADs) additional aircraft, any plethora of nastiness, including ships to intercept the carrier. This is a worse than WORST CASE SCENARIO.
In addition to that the enemy would have more than enough time to clear out the illegal site. You really don't know how fast people can REALLY move until you see a bunch of soldiers clear out a base under emergency orders. By the time you've recovered from the shock of such a sight the base is barren. Let me put it this way - even if all the machinery was WELDED to the ground if the order came that the site is under attack and needs to be cleared the people there would, literally if they have to, grab buzz saws and cut the equipment apart in order to move it pronto and worry about assembling it or fixing it later.
- Third, yes if the SAM sites are destroyed the jets can fly higher but because the airfield isn't destroyed the enemy would immediately scramble jets and we saw how hard it was for Maverick, arguably the best pilot the US have (in that universe), to handle one such jet, let alone him + the other less experienced pilots to take on more.
I want to note Tom Cruise is a distinguished pilot irl. This isn't related to anything he's just a swell guy.
- Fourth, what if the carrier entourage hit both targets? The amount of missiles the strike group carries depends on what kind of carriers and destroyers or submarines are in the group. The missiles are stored and launched in vertical launch system tubes and depending on the ship their count can vary wildly. The tubes can contain a wide variety of missiles, including (but not limited to) a variety of anti-ship, anti-submarine and anti-aircraft missiles. So while they can increase the amount of Tomahawks, at the very least, that would make them more vulnerable to enemy ships or aircraft that can potentially bear down on them and this isn't something you want happening. Since you don't want to have "just one" anti-aircraft missile in case aircraft attacks you but many, depending on how prepared you want to be, this means if you have 100 tubes you can't (or rather shouldn't ever) fill one with anti-air, one with anti-ship and one with anti-submarine and call it a day. There are a plethora of missile varieties and you, ideally, want to take advantage of as many as you can. Plus they don't have unlimited resources so they might even not have the tomahawks.
In the movie we saw them launching 24 missiles, considering a rough average of tubes on such a ship is 100, that's a quarter tubes with tomahawks. Which is appropriate, I'd say. We don't know how many cruisers and destroyers there were in that strike group but my point is they don't have an endless supply of missiles.
- Fourth and three quarters, why not spread the missiles and hit both targets, partially? Then you won't be getting the best of both worlds you'd be getting the worst of all worlds that exist. Leaving some SAM sites means you still have to fly low but can't due to dust and debris and having a partially functioning runway means there'd still be more jets in the air than you want. Optionally an argument can be made here that if there are a few SAM sites you could risk it and fly high and just avoid/flare the missiles but that's beyond reckless. The heroes in the movie are able to dodge/evade/flare almost all of the missiles but that's extremely lucky. Flares aren't a 100% guarantee of safety (and I'd just like to point out in the movie they use the wrong type of flare - one for infrared missiles but that doesn't matter for this point, so moving on) so I, personally, would NEVER send my boys on a mission where there are "just a few" SAM sites and just tell them to use flares. That's the equivalent of someone pulling a gun on your friend and you telling him "just duck, lol".
Something I'd like to say here - yes we see our heroes survive (almost) the SAM sites but it isn't "because they are the protagonists". Sure in bad movies the main characters have huge plot armor and there that argument is sound, however when a movie does a good job in being realistic it is more fitting to say that the main characters didn't survive because they are the stars of the movie but that a movie was made for them to star in because they survived. What I mean is, there are many heroes that survived impossible situations in war and we have tales and movies about them. They didn't survive the situations because someone was going to make movies about them later but the opposite - moves were made about them because they survived and were not made about the people that didn't.
A fitting example would be Audie Murphy, who had an absolutely unbelievable experience in World War II and had a movie made about it. My point being, he did not survive unimaginable odds because he was the hero of a movie, but vice versa.
Point being, no you have no guarantee the pilots would survive even one SAM site.