a) The buyers want to look at multiple properties as quickly as possible; b) The sellers don't want to or don't have the time to be manage all of the requests for viewings. c) If there is no viewing opportunity, then the buyer might miss a good property that matches their needs or the seller might miss a buyer.
The real-estate agents have a pool of properties that they manage and they can provide quick access to the properties. They meet the needs of both the buyer and the seller and increase the probability of a transaction.
Of course, if you can find a way to do that without a real-estate agent, you got a breakthrough innovation. However, it's fairly difficult to crack this problem since the transaction inherently tilts towards human interactions. This is why nobody has figured out an effective way to get rid of the real-estate agents yet.