I am a teacher who has taught math and electronics in a high-performing public suburban school and currently teach math and computer science in a comparably performing urban preparatory school.
There are several reasons why AP CS enrollment has flat-lined as AP Statistics has surged (here are three that came to mind immediately):
1) There are a lot more kids taking Algebra as 8th graders. These kids (assuming success through the American four year Algebra, Geometry, Algebra 2, Precalculus sequence) need a course to take senior year. Most high school teachers will suggest AP Calculus or AP Statistics as an option. My previous employer went from 1 section of AP Calculus when I started to 7 sections of AP Calculus and AP Statistics by the time I had left (enrollment declined slightly during that time). Yes, the average AP scores went down a little during that time --- but I still think it's a good thing that more kids are taking the classes.
2) Lots of math teachers are willing and able to teach AP Statistics, but few can teach AP CS. In most states you need a separate license to teach it. I teach at a private school, so no such license is necessary (my undergrad is in electrical engineering, most of my work experience was software, and thus I feel comfortable teaching the course). The topics covered on the A exam (the AB, or harder, exam that I took in high school no longer exists) are not trivial. Inheritance, interfaces, polymorphism, and sorting/searching algorithms are all presented. Data structures topics (linked lists, stacks, queues, etc.) are not taught but could easily be taught in a follow up course, since most students taking AP CS at my school are juniors. Some of my teaching colleagues who know how to program would struggle with the object-oriented focus of the exam given that they came up during the Pascal era.
3) In the era of budget cuts, if you can only get 15 students to register for AP CS, it will not run in many schools. Sometimes it's feasible to run it every other year, but often that doesn't work. Many kids who are interested in programming cannot fit two semesters into their high school schedules. AP Statistics, however, fulfills the fourth year of mathematics that many schools require and thus is easier to fit into the schedule.
Let me say that I very much enjoy teaching the course. The examination in CS is challenging and well written. There are some topics that I'd like to see added (file input / output is not typically covered). I am confident in my students' ability to take Data Structures as a freshman if they pass the exam with a 4 or 5.