I feel like this would be really annoying. At the same time, it wouldn't add that much to gameplay. The strength of monsters that can pass through walls is that chokepoints are useless against them, but if you can't hit them in walls then you have to lure them into an open area. Sure you can get surrounded in open areas, but they could do that just as well in a corridor, because they can pass through walls.
Logically, I don't see a problem with hitting monsters while they're in the walls - if they don't stick out of the walls at all how can you even see them?