AI players stop attacking infected
In my experience, that's just how they are. Just ignore them as much as you can (impossible to ignore completely), and rescue them when necessary. 'least, that's how I usually treat it.
Do this
On your Steam Library, right click on L4D2 and click on Properties
Go to the Local Files Tab, and then click on Verify Integrity of the Game files
Now you just wait for it and if something is wrong it should fix it and redownload the corrupted files.
AI in Left 4 Dead 2 is not bad but pretty limited compared to an human. If you can, try playing with friends or other unknown player.
It is much more fun and no frustration due to strange bot behavior.