As said Morocco helps the US against the Barbary pirates.
Maybe also helps against the British in 1812, idk why though.
If they resist French influence and remain independent, I can see them allying against Spain during the Spanish American War.
Give Algeria a highly pro Soviet stance during the cold war, the US will ally with Morocco