I think two questions one might fairly ask:
How great was the risk of exposure to a naval crew, bearing in mind that the risk profile of a young, fit population disconnected from everyone while at sea isn't the same as the risk to the general population?
Was there an emergency which was of graver importance than the exposure of the crew?
The unstated aim of the DOD may have been to create a community of people who have had the virus and have a very small risk of dying while they are exposed, so that they will be able to help with other tasks later on where immunity is valuable.
The mortality risk to people in their 20s is estimated to be 0.03%, 3 in 10,000, including people with existing conditions. Remove existing conditions and the risk must be close to negligible.
A herd of immune, discipled people may be valuable to perform basic tasks on land when the disease peaks. It may also be valuable to have the nation's defenders gradually immunised in case of war.
You could argue that the DOD made a calculated, moral decision, and not a reckless one.
Of course, this is the Trump administration, so most likely they didn't think about it at all!