It's probably really important to know whether gaining weight from your medication has lead you to be overweight or whether or not it's just a little gain but you're still within the 'normal' weight range.
This is something worth chatting to your doctor about! If you were already in the normal weight range, there's every possibility that the increased weight gain is only temporary as your body adjusts to the medication. Even though this is frustrating, it generally doesn't last too long.
:)
Most likely if you gained weight, it was weight you needed to gain (no matter where you started). Your body is working on fighting diabetes and its size isn't the concern. You've done nothing wrong and your body is just taking care of itself.