Owning a Bible is not forbidden by law in Morocco. (If there is legislation, you are misinterpreting its scope and intent.) Morocco has its own Roman Catholic jurisdiction[0]. There are even Roman Catholic monasteries/convents in the country that do philanthropic work with rural communities, on the condition that they don’t try to openly convert locals, and of course they all possess Bibles and liturgical books for their services.
This is something that even tourists are often aware of, because in Tangier the Anglican parish[1] is a popular tourist attraction. The Agadir Roman Catholic parish is attended by also some of the loads of German/French/Italian pensioners who spend winters there.
[0] https://en.wikipedia.org/wiki/Catholic_Church_in_Morocco
[1] https://en.wikipedia.org/wiki/St_Andrew's_Church%2C_Tangier