Beyond all the practical (and very real) issues, there is also deeper issue that's not necessarily spelled out in details in the regulations themselves but definitely guides EU law: state sovereignty and the proportionality and subsidiarity principles. Recital 28 of the Schengen Visa Code touches upon that:
Since the objective of this Regulation, namely the establishment of the procedures and conditions for issuing visas for transit through or intended stays in the territory of the Member States not exceeding three months in any six-month period, cannot be sufficiently achieved by the Member States and can therefore be better achieved at Community level, the Community may adopt measures, in accordance with the principle of subsidiarity as set out in Article 5 of the Treaty. In accordance with the principle of proportionality, as set out in that Article, this Regulation does not go beyond what is necessary in order to achieve that objective.
In general, EU law curtails member states' sovereignty in that they relinquish certain decisions that would otherwise properly belong to each state. The idea of the subsidiarity principle is that it should only happen to the extent necessary to fulfil specific goals (like improving the functioning of the single market).
By default, deciding who gets to enter and stay in a country is up to each country. In the EU, visas are still primarily national matters with limited exceptions like the EU Blue Card and short stays (i.e. the visa and entry rules enshrined in the Schengen acquis). Each of these exceptions have to be justified by the goal and strictly limited to the measures necessary to achieve that goal. That's what recital 28 reaffirms.
For example, one goal of the Schengen area is to foster tourism by making it easier to visit several countries in the Schengen area. Concretely, it means that e.g. Italy effectively gives up its sovereign power to screen tourists entering the country from France by lifting border checks and recognising short-stay visas issued by France. It doesn't mean Italy wants to completely relinquish its power to decided on immigration matters or outsource it to France.
The rules in article 5 of the visa code (“Member State competent for examining and deciding on an application”) are a practical implementation of this principle, ensuring that countries still get a say on trips to that country, with fall-back rules when it's not obvious. As should be clear from this explanation, the rules on the primary destination are therefore totally unrelated to the substance of the decision but entirely dedicated to figuring out who (which country) should take that decision.
Additionally, your vision of what the visa decision should be about is simply inaccurate. As a matter of law, the purpose of the trip is one of the criteria listed in the Schengen Borders code, namely in article 6(1)(c). Note that technically the Visa Code simply refers to the Borders Code, any and all of the conditions for entry listed in this reference are fair game when examining a visa. Entry and/or a visa can therefore be refused if the purpose for the trip is not deemed credible and that's one of the standard justification for refusal defined in the regulation.
That's why the specific flight a visitor wants to take or the hotels they intend to stay at are relevant and can be taken into account when reaching a decision. For better or for worse, examining the trip's purpose seems reasonably common elsewhere in the world and part of the questioning you can expect, e.g., at the UK or US border. It doesn't really have much to do with the Schengen-specific issue of determining what the main destination is.
That said, I have already explained elsewhere that I do not think decisions like the one in My Schengen visa got revoked mid-trip, what should I do? are always justified. While applying to the country that's your primary destination is a requirement for political and practical reasons, it's not forbidden to change your mind and it doesn't follow that a visa ought to be cancelled when you do that.
I know it happens but it's hard to see how it's not an abuse or misunderstanding of the rules on the part of the state taking that decision. The only thing that justifies rescinding a visa is if the conditions for entry are not fulfilled anymore, which may or may not be the case. It also seems a little absurd to merely revoke a visa when the person is inside the EU and not in the custody of law enforcement (it implies that you think the person shouldn't be admitted in the Schengen area but you're tipping them off while they are already freely roaming the area and admitting they have done nothing wrong!?). Annulment would be a possibility but it implies that the visa was fraudulently obtained, i.e. that the applicants lied when they got the visa and that cannot be established merely based on a change of plans.
Note that the phrase “visa shopping” appears in the regulation with a slightly different meaning (especially in recital 18). In that case, it's not about which member state is competent but the reason why it is not allowed to apply for a Schengen visa from any consulate in the relevant member state diplomatic network but only in the consulate serving your place of residence (i.e. the rules defined in article 6 on “Consular territorial competence”).