The theory of "Community Caretaker" can come into play regarding an apparently abandoned building with an open door. THe police can enter to determine what risks the building may pose in its current condotion, the need to find and contact the owner to eliminate common or attractive nuisances, and to report certain unsafe conditions which do/may threaten adjoining structures. For the same reason the cops may poke their heads and body into your home if, when passing by, they see the front door open/ajar when such would otherwise be out of line. They are supposed to verbally announce their presence before crossing the threshold, as well as before moving from one room to another or going up/down stairs from the level of their initial entry.
As there is no indication that the police took any items into evidence (spoons, vials, syringes, jars, etc.) or for forensic testing (fingerprints, DNA), I do not believe any 4th Amemdment issues arose.
If they walked by an occupied structure (either persons actually inside or evidence suggesting residence) they would need to obtain a search warrant if the suspicion was based on either a tip or smelling something as they walked by. Of course, they could knock on the door and ask to speak with you in order to obtain more Reasonable Articulatable Suspicion/Probable Cause for the warrant - including your refusal to open the door to talk with them.
stay safe.