The purpose was the quick gain over Syria. However, Syria is shithole right now. It took too long. It also effected the region dramatically. It is more than just petrol now. Trump is playing the cards. Just look at the older tweets. He is not consistent, and always changes his opinions. Also the responsibilities as the president doesnt allow him to do whatever he wants.
Before he was elected, he was talking about to support Turkey instead of pyd. At this time Turkey and Saudi Arabia were planing to invade Syria from north together. You know what happened in Saudi Arabia, somehow all the important royals have changed. Trump went to Saudi Arabia. Now Saudi Arabia and USA actively supports pyd by giving guns.
Turkey on the other hand cannot support pyd. Turkey and pyd already in a war from 1990.
Something happened in White House, Trump changed his opinion after elected. I don’t know what it is. However this change affected the Middle East region dramatically.
Sorry for the mess. I wrote it quickly and English is not my first language. If there are some points that are no clear I can explain.