This is because the enemy AI is really simple and trys to find the path of least resistance. I usually have a really powerful turret setup with holes on either side, and put walls on any other openings. the enemys assume they can walk through the holes on either side, but get obliterated by the turrets.