Clearly you don't understand what separation of church and state means, OR in fact that it doesn't exist.
All that the 1st Amendment says is that Congress shall make no law respecting an establishment of religion. This means that it cannot make any particular religion the official American religion - and that is ALL it means. The Founding Fathers knew all about what having an established religion had done to England and very reasonably didn't want it for the USA.
The 1st Amendment also states that there shall be freedom of religion. And while there are religious people in military service, entitled to practise the religion of their choice, they will want chaplains to help them observe their religion and to provide spiritual help and comfort. And they should have them so they can freely practise their religion as assured by the US constitution. I shall mention Catholics as a special case - they are required to receive communion every Sunday, consecrated by a priest, and they won't be able to get that without some priests around. You'd be depriving Catholics of their rights.
You have probably not noticed that the USA is by far the most religious country in the "western world" because of these two parts of the 1st Amendment, so chaplains perform a very useful function that the over half of the military who ARE religious will want to have. Chaplains are also there for the non-religious - going to war is possibly the most worrying thing you could ever do. "This is it, I could die." Who can you talk to in private about it? The chaplain, that's who. The chaplaincy is an easy source of people who know how to do counselling, and they will be sensible enough not to mention religion to agnostics and atheists.