The answer to why the US, to President Trump's personal regret, became involved in the Syrian war has two areas to consider. Firstly strategic and economic importance, and secondly pride and power. Syria has rich resources that the rest of the world wants access to. It has neighbours and allies that could represent a threat.
President Assad allowed Isis to gain a hold in Syria and recruit followers and train and encourage terrorists to attack western nations. The US naturally wanted to curb if not eradicate this. Further, Russia wanted to display its power to the world and claim that it had ended the war. It backed Assad to do this. The US would have wanted to be the powerful nation that claimed how it had ended the war.
The US wants to take Assad out of power and foster peace in the Middle East. The US has been heavily involved in Syria for five years and has been bombing the country for three. The US has sought to control the Syrian revolution and Civil War to ensure that there would be no outcome directly opposed to American interests.
The US wants to defeat ISIS and other groups and preserve the network of dictatorship and client regimes in the region, especially Jordon, Saudi Arabia, Egypt, and Qatar. Popular revolutionary movements may threaten this project, especially when they pose the possibility of overthrowing client regimes and replacing them with independent states.