It isn't just something in undergraduate study, it's something common across economics in general.
Consumers and producers can set quantity, not price. For example, when you enter a store, you can only choose the amount of stuff you buy, not the price at which you buy it.
This logic is a little more confusing for the producer's side of things. One of the assumptions of microeconomics (at least at the beginning of most undergraduate studies) is perfect competition, which means that both individual producers and consumers cannot affect prices by their own actions. This isn't true in some real-world applications (Apple sets the prices on their laptops, for example) but is true in some others (restaurants in competitive neighborhoods generally have similar prices for similar lunch specials).
The price is also set as the y-axis because of the demand function's connection with utility.