It wasn't, but we're comparing to the yearly budget of Manhattan/Apollo (as a fraction of GDP). NASA budget was between 0.3-0.9% of GDP in 1963-1970[0], that was per year. In 1965 GDP was $743B (nominal), so 0.5% of that is ~4B, and the (nominal) cost of Apollo (which wasn't the whole NASA budget) was 25B.
As aa part of GDP from 1970 (1.073T) the total cost of Apollo would be like 4% of that single year's GDP. Not a good comparison because when Apollo started GDP was 563B and was 1.3T when it ended.