Why does a us president have to be born in the US?
You do not have to be born in the US to be president. You are Constitutionally required to be a "natural-born" citizen, which means to be born on US soil or born on foreign soil to parents who were US citizens when you were born.
What if parents of a us president was not born in the us and are not citizens but the president was born in the us?
No. Any person running for president must have been born in the USA. You are correct that a foreigner cannot be president, because you must be a US citizen by birth. However, your answer contains a common misconception. You do not have to be born in the US to be president, which is called native-born, but must be natural-born, which means either born on US soil or to a US citizen.
A natural-born US citizen of Mexican descent can be elected President, but a person born in Mexico cannot. Article II, Section 1, Paragraph 5 of the Constitution specifies the President (and Vice-President) must be natural-born, meaning born in one of the US States, US Territories, or on a US military base. Naturalized US citizens are not eligible to run for President.
President Obama was born in Hawaii. Neither Hawaii nor Alaska are part of the "continental US." The first nine US Presidents were born on British soil because they were born within the thirteen colonies before they won their independence. John Tyler, the tenth president, was the first president "born in the USA."