Short explanation to why some pieces of evidence were dismissed and others weren't (including a link to the ruling so you can see for yourself)
From what I gleaned from the judge's decision, NY law applies as the case is in NY courts and the crime occurred in NY.
NY law does not allow a warrantless search unless the property is in the suspect's immediate control or "grabbable area" (actual term used by the judge), and even then only if the circumstances support a reasonable belief that the suspect could get a weapon from the bag or attempt to destroy evidence.
The judge decided this was not the case in the initial search, undertaken in the McDonalds where Luigi was found, based on the bodycam footage from the police. In this search, the officers did not open all compartments in the bag and thus did not find the gun. The evidence found in this initial search was thrown out -- that includes the magazine, cellphone, passport, wallet and computer chip. On the bodycam footage, the officers can be heard arguing about whether they could or should search further. One officer justifies the search as being out of concern for there being a bomb in the backpack. Even though they found the journal in this initial search, the judge decided based on some precedent that because it was not open, it didn't count as "being found".
After he was taken into custody, police applied for a search warrant, which was granted. This was found to be irrelevant because they requested it because of the previous search. But it was all moot since they then undertook a more thorough inventory search (which is done with the belongings of everyone who is detained) where they found the gun and opened the journal. That's why these items were admitted, as that search was considered lawful. Inevitable discovery was never mentioned in this ruling -- there is precedent in NY law that makes that much more restrictive than normal.