The duplication is beneficial for defense. Once the first line is penetrated, defense becomes very difficult. More countries mean more first lines of defense.
There can be advantages for coalitions in a war. There are also disadvantages. However, this is not the point I made. The only point I made is that $x spent by say 15 countries on defense is not at all equivalent to $x spent by a single country on defense in terms of military power, force projection, etc. due to the aforementioned duplication of HR, admin and other ancillary roles in supporting a military force.