The United Arab Republic failed because Nasser's Egypt effectively treated Syria like it was a vassal state, not a equal Arab state. Nasser demanded that all political parties in Syria be banned and attempted to form a centralized authority based in Damascus for one half of the year and in Cairo for the other half of the year, abolishing all regional governments in the process. This dominant attitude from Nasser effectively created the idea of Syrian nationalism, which slowly built up popularity until the military overthrew the UAR-aligned government in 1961. The government that replaced it eventually became so unstable that it was overthrown in 1963, leading to the Ba'ath Party-led dictatorship that leads Syria to this day.
Nasser's extreme secularism is also bound to be a cause of tension in this united Arab nation. He once famously mocked the Muslim Brotherhood for demanding he force Egyptian women to wear headscarves.
Also, other nations in the Middle East saw the UAR as a threat, especially Lebanon, Jordan and Iraq, leading to the latter two forming their own union to combat the UAR. In fact, tensions in Lebanon over whether or not it would join the UAR were so tense that it led to a three month civil war, which necessitated a US military intervention, despite Nasser making it clear he never wanted Lebanon in the UAR.