I have literally never seen a judge throw out a criminal complaint filed by the police for failing to show the proper allegations that the crime was actually committed.
This sounds like it was not good police work by whoever drew up the complaint and was a definitely trumped up based on the evidence they had at the time.
Iowa code 124.407 states that it's a crime to "sponsor, promote, or aid, or asist in the sponsoring or promoting of a meeting, gathering, or assemblage with the knowledge or intent that a controlled substance be there distributed, used or possessed"
I think that police had no one fess up to the marijuana, so they couldn't charge with possession. This is kind of the default charge when they can't charge with possession but found drugs. However I think it lacked probable cause for the charge because the weed was not being distributed, used, or possessed. I think they could get evidence for constructive possession if they wanted and refile the charges, but at the time they did not have sufficient evidence for this.