Lenders put in this condition a) because it was noted on the application that you wished to use the funds for this purpose b) to satisfy their minimum NDI requirements and therefore increase your mortgage eligibility. If you are servicing debt that will decrease your NDI further, they may make it a condition of the offer that the debts are cleared so you should be able to service the mortgage repayments more easily.
They can't make you cancel your credit card but sometimes after clearing off debt and getting a top up, its a good way to start to money manage more effectively. (I'm not saying this is your situation).