Type 1 can come on quite slowly in adults. It's very possible that, unknown to you, the islet cells in your pancreas were being destroyed by your immune system. You have to lose around 80% of them before you start showing signs of diabetes.
It's possible the stress of the operation may have tipped you over the line into obvious diabetes. If you're concerned about damage during the op, I'd talk to your GP and/or the hospital.
Why you? Just bad luck, I'm afraid. Type 1 is more environmental than genetic. Sadly we don't know what the trigger is yet.
It does get easier dealing with it. Knowledge is power. Learn as much as you can and then you can control the diabetes and not let it control you