Well, the F-35 is actually a useful instrument which maintains US hegemony. A better comparison would be the movie Cats, which had a budget of 95 million, and serves no purpose to society.
What we need is to get scientific instruments categorized as artwork.
You can buy arecibo for $120M. You can't do anything with it, and you give it on loan to the NSF. Then eventually you can transfer it to somebody else.
The flyaway cost for domestic units of the F-35 are about $100M. [1]
The FAST radio telescope in China cost about $170M. [2]
While the Arecibo Telescope is significantly smaller, costs if rebuilt by US contractors would also be much higher than in China.
FAST can also only use about 300m of its 500m dish at a time due to limitations with focusing, so its effective size is closer to the Arecibo Telescope than its total size suggests.
So make that two F-35 and we're pretty much spot on and we'd have a budget for some 3-5 years of operation, too.
Wikipedia seems to have the unit cost for a F-35 at a hundred million dollars.
While I cannot find a number on the construction cost it seems that just running the observatory originally cost around ten million a year. So even if one F-35 was enough to finance a rebuild you would have to drop in a second to keep it running for just a few years.