Dear Sanjeev,
By the term "CTC" we should not restrict our imagination merely on point of view of the HR. CTC (cost to company), as the term reveals is an accounts & finance term that intends to denote commercial accounting of transactions made with reference to the staff & establish matters, rather than any HR activity. For the purpose of HR, the terms of salary, wages, pay & allowances and the emoluments can well be used. The CTC in a company denotes commercial vallues for the purpose of accounting, as the company has to maintain its accounts on commercial pattern for arriving at the true results of profit & loss and assets & liability after shouldering its likely liabilities during and/or after the service period of the employees.
So, with reference to your assumption and question, "deduction towards Payment of Gratuity is legal or illegal? Gratuity becomes payable, if and only if, an employee completes FIVE years of continuous service with organization. If an employee leaves the organization within FIVE years of joining, he is not paid the Gratuity Amount, even though the amount has been deducted from his CTC and kept aside. Do you think deduction made from the TCTC of an employee towards payment of gratuity, is legal or illegal? Is it ethical," I would like to say that gratuity element in CTC is not a deduction, rather a held up amount to show liability that the company has to evenually bear in making payment after the employee actually becomes eligible, as per the law of the land. The said liability gets included every year in the annual accounts of the company to arrive at the true position of its profit and loss on commerical accounting pattern for the purpose of information to its stake holders and the share holders, so that the burden may not affect its revenue and profits in lump in the year of payment. In other words, that is just to facilitate smooth sailing of their funding position and to reveal the real financial health of the company from year to year basis.
So, the question of ethics, legality or deduction of gratuity does not arise when it is concerned with the HR functions or the salary/ wages of the employees, as that denotes a presumptive nominal value for the purpose of funding the operations of the company and to bear when becomes due to be paid. However, if that does not become due to the employee due to his ineligibility that remains as part and parcel of the profits & losses of the company that alsready stand incorporated in the books of accounts of the company.
So, it is quite legal and has no illegality or against ethics. Rather that helps the employee to show his real worth when applying for another job elsewhere.