The main purpose of this legislation, known as the Headstones for Honor Act, is to ensure that certain enslaved individuals and those who performed military functions despite being ineligible to serve in the Armed Forces receive proper recognition after death. This includes providing headstones, markers, and medallions for their graves.