I am sorry to hear your involuntary downgrade experience.
Each airline has their own rule on who to be downgraded. Very often, it is not about how much you paid but which fare class you booked in. For future reference, DOT has regulations regarding this and you are entitled to a refund in fare difference between the class you booked and the class your end up flying. However, this is often difficult to do as you, the passenger, is unlikely to show proof of lower class ticket price of that trip to get that refund. The gate agent processing this are under enormous pressure to get the flight out and they often can only get the current price for the flight which may be more expensive than your first class ticket, hence not issuing the refund. Also, this is relatively rare situation that most agents are not familiar with the SOP. Major airlines, such as DL, AA, UA, have dedicated team to resolve this and give you refund after your trip (you need to call inand request). Low cost airlines are more likely to play games and refuse to help (they probably don’t have first class service anyways)
Another situation that is not well understood by the general public is called YUP fare. You may have noticed that first class tickets these days are not as outrageously expensive as they used to be. A lot of these are actually coach ticket that include an instant upgrade. This is not clearly shown during the booking provess and it is unreasonable to expect consumers to know this is what they have purchased. But this is world we live in. If you read your fare information carefully you will find this buried within. These tickets are often the first in line to be downgraded for many reasons. In this case, some clueless airline agent may claim you never actually had a first class ticket in the first place and the DOT regulation can be difficult to apply.