There's at least one or two Startrek Original series episodes with this theme.
Also in the Warhammer 40K setting the understanding of technology is, somewhat different to how it is today. The Imperium (human) forces have basically very little idea how much of their ancient technology works and machines are regularly said to have a "Machine Spirit." With the vast foundry worlds, like Mars, having the Adepticus Mechanicus, who basically do worship the Machine God. Much of it is modern tech given spiritual names - so holey oils might be giving it an oil change; the machine god might be some form of AI (not actual AI nor acknowledged as such since AI is outlawed*). So in a way machines, rather than AI is worshipped.
To the Ad Mech and many of their ilk machines are holy and there is a Machine God. Even though they also pay homage to the Emperor - the God of Mankind. Who sits upon his Golden Throne at the heart of the Imperium (Terra) in a state of perpetual coma; his powers used to help run what is basically a huge lighthouse which allows their ships (and those of other races) to navigate through what is basically a hell dimension - which is how they achieve faster than light travel. The cost for this is a simple sacrifice of around 1000 psychically sensitive people a day.
*machine thinking and processing is done by servitors which are basically human skulls with the brain intact; the memories wiped and the mind used to process and perform calculations. Basically cyborg slaves.