This is not entirely fair. The actual landings (which did teach us a lot about the moon) were just the tip of an iceberg. Consider project Gemini [1] for example. A dozen missions and several astronaut-weeks of space time to get hang of such consepts as rendezvous and docking of two spacecraft and extra vehicular activity, all of utmost importance in modern space exploration. Much of the hardware developed for the Apollo program was also very versatile, as demonstrated by, for example, the Skylab program [2]. A lot more mileage could have been extracted from the investment by means of the Apollo Aplications Program [3] had it not been killed to make way for the STS (I'm simplifying the history somewhat on this point).
[1] https://en.wikipedia.org/wiki/Project_Gemini
[2] https://en.wikipedia.org/wiki/Skylab
[3] https://en.wikipedia.org/wiki/Apollo_Applications_Program