The operating costs of NATO are something like £2bn in total which is a tiny fraction of each members defence budget. The 2% of GDP that is often mentioned is not given to NATO. It’s the the minimum that is supposed to be spent by each nation on its own defence so that whenever NATO needs to front an operation, each member can make an appropriate contribution.
An EU force would consist of EU members putting a proportion of their own forces under a centralised EU command, so the two things are not mutually exclusive and wouldn’t necessarily cost individual countries any more. We were going to opt out of an EU force anyway whether we were in or out of the EU. Now it’s no longer up for discussion.