He was tempted by the thought of seeing his family again and having a chance to apologize.
It was an extremely careless and stupid mistake to put the Horcrux ring on, especially knowing that it was a Horcrux and the Dark Lord would have placed a curse on it, and afterwards Dumbledore himself admits that it was a foolish mistake to make. However, his guilt over his sister's and mother's deaths drove him to momentarily forget that the Resurrection Stone that would let him see his family again was a Horcrux, and he put it on.
“After another short pause, Harry said, ‘You tried to use the
Resurrection Stone.’
Dumbledore nodded. “When I discovered it, after all those years,
buried in the abandoned home of the Gaunts, the Hallow I had craved
most of all – though in my youth I had wanted it for very different
reasons – I lost my head, Harry. I quite forgot that it was now a
Horcrux, that the ring was sure to carry a curse. I picked it up, and
I put it on, and for a second I imagined that I was about to see
Ariana, and my mother, and my father, and to tell them how very, very
sorry I was …” - Harry Potter and the Deathly Hallows, Chapter 35
(King's Cross)
He was thinking only that he would be able to apologize to his family for everything he saw as selfish mistakes of his youth, the guilt of which he'd carried for years, and not of the obvious danger of wearing one of the Dark Lord's Horcruxes.
He admits to Snape that putting on the ring was a foolish mistake, though he doesn't admit to Snape why he made the mistake of putting it on.
“Why,’ said Snape, without preamble, ‘why did you put on that ring? It
carries a curse, surely you realised that. Why even touch it?’
Marvolo Gaunt’s ring lay on the desk before Dumbledore. It was
cracked; the sword of Gryffindor lay beside it. Dumbledore grimaced.
‘I … was a fool. Sorely tempted …’
‘Tempted by what?’
Dumbledore did not answer.”
He attempted to play it off as related to the ring being a Horcrux, but we know that's not true.
“Did you think that breaking the ring would break the curse?’
‘Something like that … I was delirious, no doubt …’ said Dumbledore.”