Have Cat Questions? Ask a Cat Vet Online.
It could be an allergic reaction to a bug bite or it could be an ear infection.
I would clean it well and search all around for a bump that might indicate a bug bite.
You can clean the outside of the ear with a little peroxide and see if it helps. If it does not start to resolve, you will want to see the vet to have it checked to ensure that there is not an infection.
You should discourage the scratching as much as you can because it can cause a hematoma and they take surgery to repair.
Let me know if you still have questions.
Diabetes can be a factor in a lot of problems but I don't think that what you are seeing is caused by that.
Keep in mind that cat's ears are not made like human ears. The infection happens far into the ear so you will not see redness or swelling in the outer ear.