Morocco is not a part of the African Union because they have always liked to stay to themselves. Actually, they left the union of Arabs in 1984 and stayed out for around 33 years. Then, they were readmitted and so all African nations are actually part of the Arab Union.
It wasn't really a smooth effort though and they weren't all for it but they are in it now and that is how it is. They are more independent than some in Africa and don't fall for just anything so expect for them to stand their ground. Still, they are part of the Union informality at least for now..