I'm looking for a short story that was published before the 70s. It described two visits to an earth-like planet. The first found a polluted, divided, combative culture. The second found a peaceful unified culture and the planet possessed two moons, the second was a huge computer. The computer was used to answer two profound questions that set the stage for the planet's development. "Who or what created the Universe?" "What is the purpose of the Universe?" The planet's historian shows the visitors a monument that contains the printout with the computer's answers. The answers are: "The universe just happened." "No purpose, it just is."
I think you're mixing up two short stories: "Limiting Factor", first published in Startling Stories, November 1949, and "The Answers" aka ". . . And the Truth Shall Make You Free" from Future Science Fiction, March 1953 (available at the Internet Archive), both by Clifford D. Simak. "The universe just happened" is an exact quotation from the latter story, where it appears on a computer printout.
"Limiting Factor" has contrasting earthlike planets and a world-sized computer, "a big one that covers an Earth-size planet for the depth of twenty miles":
First, there were two planets looted of their ores, mined and gutted and left there naked for the crows of space to pick.
Then there was a planet with a faery city, a place of glass and plastic so full of wondrous beauty that it hurt one's throat to look.
But there was just this one city. There was no other sign of habitation on the entire planet. And the city was deserted. Perfect in its beauty but hollow as a laugh.
Finally, there was a metal planet, third outward from the Sun. Not a lump of metallic ore, but a planet with a surface—or a roof—of fabricated metal burnished to the polish of a bright steel mirror. And it shone, by reflected light, like another Sun.
The story is told from the viewpoint of human explorers who figure out that the world-machine is an alien computer:
It was an oblong card, very ordinary-looking, and it had holes punched in it in irregular patterns.
Scott held it in his hand, and his hand was shaking.
"I trust," said Griffith bitterly, "that you're not disappointed."
"Not at all," said Scott. "It's exactly what I thought we'd find."
"Would you mind?" said Griffith finally.
"It's a computation card," said Scott. "An answer to some problem fed into a differential calculator."
"But we can't decipher it," said Taylor. "We have no way of knowing what it means."
"We don't need to decipher it," Scott told him. "It tells us what we have. This machine—this whole machine—is a calculator."
"Why, that's crazy," Buckley cried. "A mathematical—"
Scott shook his head. "Not mathematical. At least not purely mathematical. It would be something more than that. Logic, more than likely. Maybe even ethics."
"The Answers" is about a visit to a single earthlike planet with a peaceful human culture and a room-sized computer which answers two profound questions:
"In just a little while," he said, "you will understand why we are simple people."
He swung the door wide open and stepped to one side so that David might walk in ahead of him. The place was one large room and it was neat and orderly. There was some dust, but not very much.
Half of the room was filled to three quarters of its height with a machine that gleamed in the dull light that came from some source high in the roof.
"This is our machine," said Jed.
And so it was gadgetry, after all. It was another machine, perhaps a cleverer and sleeker machine, but it was still a gadget and the human race were still gadgeteers.
"Doubtless you wondered why you found no machines" said Jed. "The answer is that there is only one, and this is it."
"Just one machine!"
"It is an answerer," said Jed. "A logic. With this machine, there is no need of any others."
"You mean it answers questions?"
"It did at one time," said Jed. "I guess it still would if there were any of us who knew how to operate it. But there is no need of asking further questions."
"You can depend on it?" asked David. "That is, you can be sure that it tells the truth?"
"My son," Jed said soberly, "our ancestors spent thousands of years making sure that it would tell the truth. They did nothing else. It was not only the life work of each trained technician, but the life work of the race. And when they were sure that it would know and tell the truth, when they were certain that there could be no slightest error in the logic of its calculations, they asked two questions of it."
"Two questions," Jed said. "And they found the Truth."
"And the Truth?"
"The Truth," Jed said, "is here for you to read. Just as it came out those centuries ago."
He led the way to a table that stood in front of one panel of the great machine. There were two tapes upon the table, lying side by side. The tapes were covered by some sort of transparent preservative.
"The first question," said Jed, "was this: 'What is the purpose of the universe?' Now read the top tape, for that is the answer."
David bent above the table and the answer was upon the tape:
The universe has no purpose. The universe just happened.
"And the second question . . ." said Jed, but there was no need for him to finish, for what the question had been was implicit in the wording of the second tape:
Life has no significance. Life is an accident.
"And that," said Jed, "is the Truth we found. That is why we are a simple people."