DHAKA, Bangladesh—Machete-wielding assailants shot and hacked to death the editor of Bangladesh’s only gay magazine, the latest in a series of attacks on liberal voices that has heightened fears of growing radicalization of fundamentalist Muslims in the South Asian nation.

Xulhaz Mannan, 35 years old, one of his country’s best-known gay-rights activists, and a friend, named as Mahbub Rabbi Tonoy, were killed in Mr. Mannan’s home in the capital, Dhaka, police said. Witnesses said six men forced their way into the apartment...