He was being observed by KGB - you (and so did Legasov) could see an agent watching him from the car. If he simply left the tapes in his flat, there would be found and destroyed when militia/KGB would check on him and found his body.
By leaving them outside, presumably in a place that his friends knew about, he was sure that they will be heard by a wider community. The tapes are real (and so was his suicide), you can find the transcripts here. He has succeeded in sending his message:
Legasov claims political pressure censored the mention of Soviet nuclear secrecy in his report to the IAEA, secrecy which forbade even plant operators having knowledge of previous accidents and known problems with reactor design. The Bulletin of the Atomic Scientists also stated that Legasov had become bitterly disillusioned with the failure of the authorities to confront the design flaws.
Legasov's suicide caused shockwaves in the Soviet nuclear industry. In particular, the problem with the design of the control rods in Chernobyl-type RBMK reactors was rapidly admitted and addressed
In real life, he presumably just most likely has given them to someone - the 5th tape has been recorded as a form of an interview with a writer Ales Adamovich.
As to why they have been displayed as hidden in the series - it was supposed to display his current state - constantly under observation, unable to reach openly to anyone.