It comes from the same place as their hatred for all other infidels. The Quran.
Human history since 622 has been distorted and disfigured by Islam's hatred for non-Islamics: Jews, Armenians, Hindus, apostate muslims, the Danish, etc. It's simply incorrect to state that Islamic hate must have been due to something America did.
Muslims will kill their own daughters due to a perceived slight to their Ird - why should we expect there to be a rational cause for their hatred for the US?
There are free non-Muslims in Peru, Norway, South Africa, Mongolia, and Australia. Why don’t Muslims fly planes into buildings and pursue jihad against these nations?
It's also simply incorrect to state that our foreign policy has nothing to do with how high up we are on their priority list of enemies.
That's not saying we deserve their enmity...it's saying that when we oppose evil, we should expect evil to push back. 9/11 was evil pushing back. No earth-shattering revelation there.