At least 12 employees of the U.N.’s Palestinian refugee agency had connections to Hamas’s Oct. 7 attack on Israel and about 10% of all of its Gaza staff have ties to Islamist militant groups, according to intelligence reports reviewed by The Wall Street Journal.