Because it hasn’t always been bad.
For example, in Tunisia during the 19th century mixed faith communities would make pacts of protection in case of conflicts or feuds:
In times of danger […] each Jewish family had a Muslim guarantor to whom it would turn; this person was supposed to protect them from injury and to avenge them if they were harmed.*
How strange, that we seem to be going backward in terms of societal prejudice and persecution, rather than forward.
Our ancestors may have got many things wrong, but some things wonderfully right.
Like communal cohesion.