Letters of recommendation
There is obviously more to the story that would raise this question. Ordinarily it is ethical, in my opinion, to request a letter from anyone you trust to be kowledgeable and honest about assessing your work and work ethic or character to a prospective employer. This could be anyone in the company you have just left. regardless of their position.
It appears you are leaving because of some ethical or non-ethical disagreement with upper management., so you ae not likely to offer the one who requested you to leave as a reference, but anyone else is perfectly appropriate in my view. Good Luck!
Spud