I have to say that I completely empathise with this.
Back in 2018 - when living in Barcelona for a few months - I found several hundred US dollars rolled up into a tight what and secreted behind a really horrible oil painting of an elephant on the wall of our flat. ($667 - to be precise.)
I spent far more time wondering about the events that led to the money being there than I did enjoying the cash.
Clearly someone had vacated suddenly, and the only broad options I could picture were related to accident or criminality. The former played on my mind (although it still really didn't explain why the cash was hidden behind a picture in the first place), and I thought about trying to trace an owner, but the only option for doing that was our landlord, who was a bit shifty - and I know the cash would never have gone the other side of his pocket had he known about it. I asked my partner's dad - Spanish, and an absolute gent - about handing it to the police; he literally guffawed.
In the end, I gave it to my then partner - who was more skint than I was. I still wonder about it sometimes.
I also spent an hour or two checking the flat for other caches - air vents, behind kitchen plinth boards, cistern etc. I wasn't after more money - but I was a bit concerned that if the flat had been used for something dodgy then there could be stuff hidden away that people might be tempted to come back for, and I wanted some warning.
(Oh, and some quick advice to any potential criminals who want to hide cash safely behind paintings: make sure they're hanging straight when you're done - some of us do not suffer a picture to hang askew.)