A temporary solution for newly placed factories is to replace in the layout.lua file factory-wall-N with factory-pattern-N.
EDIT:
Better solution:
Go to prototypes/tiles.lua, and then edit the mask of each wall. Replace edge_mask() with floor_mask() for each wall, or whatever collision mask the pattern/floor tiles use.