There's a very simple structure that works very well.
It's called a career.
If you want a career in the film/TV business, it is not in your best interests to leak information.
Sure, the further down the pecking order you are, the less likely you are to be trusted. A supporting artist (extra) won't even know the script for the scene they're actually filming right now, unless they're close enough to hear the dialog. They will have absolutely zero knowledge of how this scene will fit the overall plot. They'll also, on any big budget production, have had their phone (or anything with a camera) taken off them the minute they got to base.
Right at the top are the director and principal actors, who will have full knowledge and simply be relied on to not tell people outside that circle. It's simply how the industry works. Seasoned professionals are used to this, it's part of the way of life.
There is absolutely no incentive for them to leak plot details. They wouldn't want to damage the production they're currently working on and the biggest stars simply couldn't be bought. No newspaper in the world has more to offer for a story than Hollywood's salaries are providing.
Everyone else in between has a good, solid reason to not tell what they know.
They do this for a living, all day, every day. When this production is finished, they'll move straight on to the next.
They want to be able to do the next job, and the next after that....
Leaking plot details or photos is a great way of a) being kicked off this show, and b) being blacklisted from any others coming up (word of mouth is enough, it's a small world if you're in it).
NDAs are a part of the industry. Everybody will sign one... but that's not what stops people giving away the secrets, it's just the legal recourse should they actually leak information.
The desire to make a career, to keep working in the industry is the simplest way to prevent leaks. The same people work on all the productions. You meet everybody more than once. They are not isolated incidents, like the finished movies released to the general public, they are today's bread and butter. Enough people to fill a small town, but across your life you will meet them all many times.
The 'disgruntled whistle-blower' or 'low-down scoop plot-leaker' isn't really a part of the industry - they're characterisations from movie plotsNotably L.A. Confidential. Most 'leaks' are accidental, or someone from outside the industry managed to get somewhere they shouldn't have been; like paparazzi. For everyone inside the industry, if you don't like this production, move on to another. They all work the same way to greater or lesser degree, but some might suit one temperament better than another. You don't like the pressure and last-minute chop-and-change of the big budget movie, then move over to TV, where the job is the same, but the pressures and schedules are less at the whim of the director.[1]
Of course, there are instances where different endings are filmed, or scenes are shot and discarded before the final cut - sometimes to throw people off the scent, sometimes more mundanely because the ending and sometimes the journey to it are yet to be decided, so options are shot while everybody's still there rather than being forced to do it as part of reshoots, which might be up to a year later. Reshoots often happen, but trying your best to avoid them is better than struggling with awkward cast availability later.
Think of Henry Cavill and his moustache, which gave a great headache to VFX when he wasn't allowed to shave it off for the Superman reshoots. See https://www.esquire.com/entertainment/movies/a22626767/henry-cavill-mustache-controversy/
Late addition
There's one further reason that just occurred to me but is probably not immediately obvious to an outsider.
The actual plot of a movie is of far less interest if you work in the industry. Even a lot of the higher-up artistic contributors; the costume designer or director of photography, set designer or gaffer (head of lighting), for instance, don't really have any vested interest in the plot itself. They need to control their own department, ensuring costume and picture, lighting, etc have the correct look for all the scenes, but they don't need to know really how these all link together.
That will fall to the director. The final cut of the final story is entirely within their purview (no matter who else might want to interfere in that process, studio, test audiences).
Everybody else, quite frankly, gets a bit blasé about it all. They've "been there, done that, worn the T-shirt" or cold weather jacket, or hoodie... It's tradition that crew wear items of clothing tied to specific movies and only ever available to the crew of that movie - but no-one ever wears this movie's clothing, until they're on the next movie.
It's all a whole lot less romantic and glamorous than you might think. Standing outside in a muddy field full of extra large 'caravans' watching batman wandering off to hair and make-up in a fluffy dressing gown, coffee in one hand, cigarette in the other (not a real scenario) kind of knocks the shine off the whole thing.
After comments:
Some personal (but not too detailed) background. I've worked on hundreds of productions, from TV shows and little indie movies to major Hollywood blockbusters - but I'm a tiny, tiny cog in a very large machine; I'm not 'best mates' with famous actors or directors. I do work actually on set, which is as good a place as any to learn about the industry, as opposed to 'backstage' in production. I'm usually a supporting artist, occasionally a bit-part actor (day player). I just pay attention, watch and listen to what's going on. I'm a retired sound engineer and audio producer, also an amateur photographer, so I understand a fair amount of the 'tech stuff'.
The glamour of a movie base - mud, trailers and pouring rain (took me a while to find one where no-one is recognisable).

[1]Personally, I don't like working on movies, I prefer TV. On movies, sure the money's good, but the days are wickedly long. Plus, you almost never know whether you're working tomorrow until the end of today. Your diary can show you're busy for the next three weeks, then someone changes their mind and those scenes vanish, or are put back to be replaced by scenes you're not in - so you go off to twiddle your thumbs for the next six weeks. Did I say three, yeah that just became six... and so it goes.
...which is why I've the time to spend editing and re-editing this answer… my show just got delayed six weeks :/
Late, late addition - or Johnny Depp 'resigns' from the production and leaves everybody in turmoil :/
Breaking News It's usually the public who leak things. I walked past this car & its twin several times a day for a week or so, in a compound where they're creating the vehicles for the next Batman. This didn't leak from within, but from without. The public just love to post spoilers. The industry doesn't. It's not a plot spoiler, but it's irritating nonetheless. - https://gmauthority.com/blog/2020/10/bruce-wayne-drives-1963-chevy-corvette-in-the-batman-video/ [one of dozens of re-posters of the original leak, this one with more photos]