Because if someone found out about it then they may have been
1. Taken out of their military positions
2. Beaten to death, hung, or shot by their peers
3. And they probably would be forgotten for what they did for America just because of loving another being
Also, just because Hamilton married Eliza doesn’t mean that there could have been someone else. Look at Maria Reynolds for Gods sake.
Also there are letters to prove that this actually happened.