Trump stupidly described other NATO members as "owing" the US. Not only had several countries met their spending goals by the end of the Obama admin most of the alliance was on track with increased spending including targeted equipment upgrade spending. Trump's complaints were that other NATO members hadn't met their goals ahead of the agreed upon schedule. This was going to be used for a pretext for withdrawing the US from NATO.
NATO funding is not a simple issue. There's direct and indirect expenditures that "fund" NATO. It's not some protection racket. Funding can be direct funding I.e. military units/equipment maintained as a rapid response force or indirect funding I.e. spending to upgrade or buy equipment to keep up with the overall norms of the alliance.
But yeah, there are many things we could better be spending the defence budget on than galaxy formation research.