It's unfortunate that the salesman didn't give you the attention and assistance you deserved, regardless of your budget. While it is true that the primary goal of a car salesman is to sell cars and make money for the dealership, it doesn't excuse poor customer service or dismissive behavior towards any potential customer, regardless of their budget.
In a professional setting, salespeople should treat all customers with respect and provide them with the information they need to make an informed decision. Even if you were not able to afford a higher-priced car, you should have been treated courteously, and the salesman should have shown you available options within your budget.
If you felt ignored or disrespected during your visit to the car dealership, it may be worth bringing your experience to the attention of the dealership management. They should be made aware of any issues with their staff's conduct and should take steps to ensure that all customers receive fair and respectful treatment.
Additionally, you have the right to explore other dealerships where you may find salespeople who are more attentive to your needs and willing to help you find a suitable car within your budget. Don't be discouraged by one negative experience, as there are plenty of car dealerships and salespeople who prioritize customer satisfaction and will provide you with the assistance you need.