The tendency towards aniconism and the erasure of the secular-religious distinction is a bit of a conundrum.
Some scholars posit that it was part of a trend from before the rise of Islam. Indeed, even in the 6th century, before the coming of Islam, there was already starting to be a drift away from representational art and a corresponding preference for geometric and stylized vegetal decoration. Notably, Byzantine artists, for instance, made less use of portraiture and depicted human figures, if any, as types rather than real people. This is seen as a reaction to the verisimilitude of Hellenic art.
So the region as a whole may have been in the throes of a cultural shift favouring abstract decoration.
In pre-Islamic Arabia, ordinary people were used to the colourful Byzantine mosaics of the churches and houses in Syria. Arab merchants bought Byzantine and Sasanian fabrics, which one account describes as follows: “stitched in gold and silver thread depicting fantastic beasts peering out at the spectator…”. They also purchased Sasanian dishes decorated with “strange beasts, gods and splendid scenes of hunting and feasting rulers”.
Over time, however, with the advent and spread of Islam, the artistic vocabulary of the region started to change. So too the objects made and sold. By the time the Islamic faith had found its own artistic grammar, Arabic culture had become nonpictorial.
Some say nonpictorialism was somehow intrinsic to Islam because of the metaphysical notion of God. That said, there are few religious texts from Islamic antiquity that positively advise against representation. But in any case, they do not have the authority of the Quran. Therefore, it would be reasonable to say nonpictorialism was not really intrinsic to Islam and the theological justification and legal injunctions for it followed – rather than initiated – Muslim cultural practice. Soon enough, Muslim philosophers helped make the arguments for the wider shift to nonpictorialism.