Arthur Geiger runs the bookstore that is actually a front for back room pornography. Geiger sells pornography and adds to the collection by taking photos of nude women without their knowledge. His most loyal employee is chauffeur Carol Lundgren (Carol is a man, in the book he and Geiger are lovers). Geiger lures young women into his house with the promise of drugs, gets them high, and takes photographs of them nude. This is why Marlowe finds Carmen Sternwood "high as a kite" in Geiger's house, sitting right in front of a secret hidden camera.
Geiger's other two employees, the conniving Brody and Agnes, are plotting to take over his business, so when Geiger is murdered they immediately pounce to take over the business by fleeing with the porn collection and acquiring "the sucker list"; the list of buyers. Brody and Agnes hope to blackmail those on the list for buying pornographic material, highly illegal in those days, which is why Marlowe disguises himself when he enters the bookstore after being tipped off across the street.
It is in their best interest to get rid of any evidence that links them to an illegal pornography racket. Despite not being party to Brody's and Agnes' scheme, Lungdren helps them to move the collection anyway. This is logical, since the police will eventually come looking for a missing Geiger and their first step would be his bookstore - filled with illegal and lucrative content that could land them in jail. If they flee with it instead, it could be taken and sold elsewhere for a lot of money. Lundgren is young, easy to manipulate and unaware of the full picture. He does however seem to twig when he sees a stranger (Marlowe) poking about asking questions.
Geiger is an associative of Eddie Mars, the casino mobster that owns the house Geiger was murdered in. It's entirely possible that they might be afraid that Mars would want to take control of the business himself in the wake of Geiger's death, thus missing their chance, so they had to act fast. It's possible that Mars actually owns or leases the bookstore, meaning if they escape, he'll take the rap instead. He certainly knew about the racket.
Another reason is the drug angle; having naked pictures of drugged up victims isn't something you want in your bookstore for police to find.
Also if they left the illegal books there, and fled empty handed, they would have to start building another photo collection all over again.