The Bangladeshi man accused of detonating an explosive device in an underground passageway near Port Authority Bus Terminal is a legal U.S. resident who was angry about “the plight of Muslims” in the Middle East, according to a senior law-enforcement official.