Both Islam and Nazism are supremacist movements, which advocate discrimination against those outside the group and death to those they deem unfit.
Had Islam been subject to the same legislative criteria as political groups, membership of it would likely be banned in places like Britain and Germany.
Islam lucked out, as we arbitrarily classify political and religious ideologies separately, there is no real reason to do so.