Yeah, it would be nice if Trek tech worked as designed but it never does. The transporter is shown to be making good and evil duplicates relatively early on and it hasn't gotten better since.The simple fact is the show has repeatedly shown people smuggling things in, diseases, disguising their identities (sometimes even species), and a bunch of other things. I know people like Star Trek technology to be perfect but 50% of the show is stuff breaking down.
The other 40% are exploration and the remaining 10% alien politics.
In this specific instance (and also with Tuvok's whole memory virus thing) the biofilter must have assumed it was part of their specific anatomy at that moment. Possibly due to the medical officer signing off on it or whatever.