Gratuity as a Statutory Liability, is for the compliance AS15 & 28. The Payment of Gratuity Act 1972 states that a company, if desires, MAY offer to its employees, anything better than the Law.
I as a professional have advised many listed Corporates (Some even the big ones) on Gratuity arrangement and compliance,Trust formation and on the contrary have surprisingly found some of the companies who actually do not have an intent to give "Employee-Benefits" but they use the Law to design those terms and conditions which saves/prevents them from doing additional funding in the Gratuity Fund every FY.
Since common people are not aware about this and mostly an Employee's average work tenure remains approximately between 1.5 - 2.75 Years, the company get an escape to pay the Gratuity to most of the employees who resigns. Besides, Some companies have 2-3 sister concerns and they keep on shifting the employees within these companies (for or the other good reasons like Promotion/Onsite opp/transfer to better office location etc) by getting them resigned and then showing their joining in another sister concern to escape this liability.
Here in your case, the situation is same, the company could have transferred you to show a continued services, but since you resigned and then joined as a fresh employee in another sister company, you legally and officially do not become eligible for Gratuity payment.