The Apollo Command Module and the LEM were built in clean rooms free of dust on earth and yet (knowing that they didn't have air locks on either module) the astronauts came in directly from the moon with dust on them. They even drove around in the Lunar Rover causing "rooster tails" of dust. Photos show they had dust all over their suits. There was no way to clean their suits. Why didn't the moon dust cause problems on their return flights?
Moon dust was a problem.
Lunar Module dust, dirt and debris contamination presented numerous challenges for several of the Apollo missions. The Apollo 12 crew observed that at 1/6-g the cabin atmosphere was excellent, however, after orbital insertion lunar dust filled the atmosphere and caused eye and nose irritation. [...] The Apollo 16 crew appears to have had themost difficulty with dust, citing the following: Velcro on the floor was caked with dust; crew feet, hands and arms were covered with dust that was transferred into the suit upon donning; the midstep was covered with dust; eye and mouth irritation; and, the cabin fan in zero-g did not appear to clean the atmosphere.
So there were plenty of problems with the dust as you can see from that report.
An airlock would not have prevented the dust from getting into the LM as you can see from those reports, since it was stuck on the surface of the suits, e.g.:
In the Apollo 14 debrief, Alan Shepard spoke of dust contamination. “We did find that we had to take the boots off because there’s so much dust in your overshoes that we did take those off before we went to bed.”
and a bit later
I guess the dust brush worked fairly well. It got most of it, but we were still pretty dirty
If the CM and LEM were built in clean rooms, it wasn't because of dust itself being a problem. They were trying to prevent materials from Earth contaminating the Moon rock samples.
The Moon dust turned out to be somewhat of a problem (it's nasty stuff). But there was no weight budget for an airlock.
Spacecraft are built in cleanrooms to prevent Foreign Object Debris. There have been a number of times where a piece of junk was inadvertently included in a spacecraft, caused a short sometime, and caused a problem at some later date. This is particularly a problem before the outer covers are placed on.
If you think about it, once the spacecraft was finished, it was lived in. There no doubt was small dust objects in the spacecraft prior to landing. And there was always stuff that showed up after the launch. The lunar dust was a larger problem, but less of a concern due to the fact that things were covered at least enough to protect them from damage against astronauts.