WASHINGTON—More than 50 retired general and flag officers have signed a letter denouncing Republican Donald Trump’s candidacy to be commander in chief, saying he is unfit because of his attitudes toward women and sexual assault.

A chief concern is that his election could imperil progress in long-running efforts to stem the problem of sexual assault in the U.S. military.

“This...