Praise be to Allah.
If a man divorces his wife, he is not obliged to spend on her except during the ‘iddah period. When the ‘iddah has ended, he has no obligations towards her, unless she has custody of his children or is breastfeeding them, in which case she is entitled to a fee for custody or breastfeeding, if she asks for that.
Based on that, there is no justification for you accepting any spending on your maintenance from your ex-husband after the ‘iddah has ended, and the ruling of the court that is contrary to sharia does not matter. Anything that you take from him is wrong and is consuming wealth unlawfully, regardless of whether you are rich or poor. Spending on your maintenance, if you are poor and in need, is the responsibility of your family.
The evidence that the ruling of the court does not make what is unlawful permissible is the words of the Prophet (blessings and peace of Allah be upon him): “I am only human. You refer your disputes to me, but one of you may be more eloquent in presenting his case than the other, and I judge in his favour because of what I hear from him. If I allocate to a person something that is his brother’s right, let him not take it, for I have only allocated to him a piece of Fire.” Narrated by al-Bukhaari (6967) and Muslim (1713).
And he (blessings and peace of Allah be upon him) said: “It is not permissible to take a person’s wealth unless he gives it willingly.” Narrated by Ahmad (20172); classed as saheeh by al-Albaani in Irwa’ al-Ghaleel (1459).
And he (blessings and peace of Allah be upon him) said: “Any body that is nourished from haraam sources, the Fire is more appropriate for it.” Narrated by at-Tabaraani from Abu Bakr; classed as saheeh by al-Albaani in Saheeh al-Jaami‘ (4519).
So what you must do is refuse to take this money, and return whatever you took, unless your ex-husband agrees to spend on your maintenance willingly, in which case there is nothing wrong with it.
And Allah knows best.