I can't recall where, but I seem to remember reading that once David Greenwalt left the show to do his own thing around the end of Season 3, the Cordy character found itself without its primary backer. As such things sorta devolved a bit as other writers took over, and lacking any real ideas of what to do, compounded with CC's pregnancy, its not surprising they wrote her out.
Yknow, I liked the whole Angel/Cordy thing. Thought the "he's in a box on the floor of the ocean" and "she's in the astral" was a nice tragic touch to the end of season 3. The stuff in season 4 was pretty bad though. The "Wait...did she just **** Connor?" thing was a bit too much for me. Course, then when you find out she's evil you sorta go "OOOOOh, I get it now". Nice to see they did bring her back for ep 100 though. It rather redeemed the character.