The footnote in the NAB for Deut 23:2 says, “Exclusion of an emasculated male may have had to do with association of emasculation with the practices of other peoples, or it may have been rejection of someone with a significant blemish who was thus not suitable for participation in the sacral assembly.”
Deut 23:14 is talking about latrines & sanitation – when you go to the bathroom outside, don’t leave your excrement exposed.