The following code works for the question:
100.0 * COUNT(CASE WHEN elevation >= 2000 THEN 1 ELSE NULL END) / COUNT(*) AS percentage_high_elevation_airports
GROUP BY state;
My question is, why does it not work if we replace COUNT with SUM? The resulting table either has 0 or 1 entry for each row if we use SUM instead.