The candidates tangled over issues like abortion, immigration, gun violence, climate change, the state of the economy and the Middle East.