Better science and tech than the other guy gives you a military advantage. Thus some fraction of your science funding is effectively military funding, and some fraction of your military funding is well spent on science.
Also, more science projects lead to more experienced scientists and engineers, which leads to a stronger pool for the defense industry.
Also, more science projects lead to more experienced scientists and engineers, which leads to a stronger pool for the defense industry.