For non-elite high schools (i.e. the vast majority of them), it is usually due to budgetary and demand constraints. Some choose an alternative way of offering advanced courses (e.g. dual enrollment with a local college).
For a relatively tiny number of elite high schools, some believe that they can design courses and curricula that are better than the AP versions.
As a practical matter, students at non-elite high schools should mostly be concerned with the presence and quality of AP courses in “core” subjects (e.g. English, math, etc.), rather than seeing a large number of peripheral subject AP courses offered (e.g. environmental science, psychology, etc.). “Quality” means, at the very least, students who do well in the AP courses should also do well on the AP tests (A students getting 1 scores does not say much good about the course).