Is it okay to have AC/Furnace intake suck air from wall cavities?
I don't think it's illegal if done right. The problem is that it seems to have been done wrong. If you have construction debris in the intake that's lazy and sloppy at best. Eventually some of that junk is going to end up in your AC unit with predictably bad results. Let's hope your filter is a good one.  

I have seen (shudder) old houses where the intake went along cavities but the builder or owner had neglected to ensure that every last hold along the joist run had been sealed. In the next cavity over was fiberglass insulation. You don't want to be breathing that stuff.