Reason (Asimov)1942) is science-fiction short story by Isaac Asimov.
Warning: Plot details follow.
Powell and Donovan from Runaround are back, but this time on a space station supplying energy via beams to the planets. The robot that controls the energy beams has been given a unique ability: reasoning. Using this skill it decides that the humans that inhabit the station are unimportant, and that it serves a greater purpose (i.e. God). The humans initially attempt to reason with the robot until they decide that they can't win, and the robot can still perform its job well. The only difference is that, as far as it is concerned, it doesn't do it for the benefit of the humans, but for its deity.
A robot that invents its own religion. The robot's designation is QT. An interesting point is that the robot still obeys all Three Laws of Robotics, albeit unwittingly. Why, if it doesn't believe in the humans on the planet Earth, should it act to protect them? (Powell and Donovan, noting that QT's religion conveniently requires it to perform all the functions for which it was created, conclude that the robot is still unconsciously following its programming, which is why they decide to leave it alone.)