You didn't, diabetes in hamsters is hard to treat,
I'm really sorry for your loss.
On the subject of treatment, some vets in the UK will perscribe glipizide to hamsters, but I think some don't like risking things like that. Hopefully you'll not have to experience it again