The council must apply any purchase money received by it on the sale of land for unpaid rates and charges in or towards payment of the following purposes and in the following order--
(a) firstly, the expenses of the council incurred in connection with the sale,
(b) secondly, any rate or charge in respect of the land due to the council, or any other rating authority, and any debt in respect of the land (being a debt of which the council has notice) due to the Crown as a consequence of the sale on an equal footing.