A Muslim must guard his tongue and should not utter words that contain disrespect toward Allah, the Most High, or objection to His decree and predestination. Allah, the Most High, is Wise in His actions and His decree. He does not do anything without purpose, and the wisdom behind what Allah has decreed may sometimes be hidden from a servant.
If these expressions are intended as an objection to Allah, the Most High, giving blessings to some people while withholding them from others, or as a belief that Allah has given something to someone who does not deserve it and deprived someone who is more entitled to it, then these are prohibited statements because they contain having an evil suspicion of Allah and questioning His wisdom and justice.
Allah, the Most High, is the Owner and Provider. He expands provision for whomever He wills and restricts it with wisdom. He says:
﴿And Allah extends provision to whom He wills and restricts it.﴾
And He says:
﴿And there is not a thing except that with Us are its treasures, and We do not send it down except in a known measure.﴾ [Al-Hijr: 21]
Not everything that a person sees as good for himself is necessarily good in reality. Wealth, status, or health may be a means of righteousness for a person, while they may also become a cause of his being tested and led astray. Likewise, poverty or illness may be a cause of patience, repentance, and returning to Allah. Allah knows best what is beneficial for His servants, and He is more merciful to them than they are to themselves.
Allah, the Most High, has made the differences in people's circumstances a trial and a test. The wealthy person is tested through wealth: Will he be grateful and give charity? And the poor person is tested through poverty: Will he remain patient and refrain from envy? Allah, the Most High, says:
﴿And We have made some of you a trial for others: will you have patience?﴾ [Al-Furqan: 20]
As for merely asking about the reason for differences in people's provisions in order to understand, without objection or discontent, there is nothing wrong with that. However, it should be expressed respectfully, such as saying: What is the wisdom behind the differences in people's provisions? But expressing it in a manner of resentment and objection to Allah, the Most High, is not permissible.
A Muslim should think well of his Lord and know that everything Allah decrees is based on knowledge, wisdom, justice, and mercy, and that whatever good he possesses is from the فضل of Allah and not because he independently deserves it.
And Allah, the Most High, knows best.