Because security is more concerned with finding weapons and drugs. Customs/Borders Enforcement is the group tasked with finding prohibited plants and animals, and they don’t usually start looking for those things until you get to the destination country.
That was probably because of the density of the cheese. I had the same thing happen to me with a bag of gnocchi once. They really thought it was something illicit because they had a big armed security guy on either side of me while they had me open it, and they looked really disappointed to find out what it really was.
I got stopped with a Panettone once. Thankfully this was in EWR so the Italian-American gate agent understood why I'd be smuggling one to the west coast.
In the US, they can't stop you from bringing a fish through, even if it's rotting. The airline can deny you boarding, if they even know about it ahead of time, but TSA isn't in charge of any of that.
I see now this is from AMS to DET, I'm not familiar with Amsterdam's security or rules, so there is a decent chance my first paragraph is incorrect in this situation.
Might have been sealed up airtight and they said it was smoked fish or something. Still, to have maggots, it's almost impossible that it didn't come through unless vacuum sealed. Yeah, that's how I should, I mean they could have done it.