Discrimination by private individuals
The first two examples involve private individuals:
Betty-White Smith, an Alabaman, thinks that all Yankees are
self-righteous hypocrites, and so refuses to serve them at her
restaurant.
John Patterson, a Bostonian, thinks that all Alabamans are inbred
hicks, and includes "Alabamans need not apply" in his company's job
postings.
Generally speaking, discrimination by private individuals based upon U.S. state of origin is not prohibited. It would be well within the authority of both the federal government and of state and local governments to prohibit this kind of discrimination. But, as far as I know, no legislation to this effect has been enacted. (In part, because it isn't something that is actually done in the manner shown in the examples very frequently, by non-governmental entities.)
Indeed, while the examples given are odious, it is routine for interstate businesses to treat residents of different states differently in order to comply for their respective state laws, for example, related to insurance policies, consumer protection, alcohol delivery rules, and sales taxes.
Discrimination by state and local governments
The next three examples involve state and local governments. The situation for state and local governments, however, is different.
There are two privileges and immunities clauses in the U.S. constitution (one in Article IV, Section 2 of the original constitution and one in Section 1 of the 14th Amendment, which apply to state created rights and to federally created rights, respectively) that (subject to some judicially created exceptions, e.g. for fishing license fees and state university tuition), prohibit discrimination based upon state of residence.
The Privileges and Immunities Clause of Article IV , Section 2 of the
Constitution states that "the citizens of each state shall be entitled
to all privileges and immunities of citizens in the several states."
This clause protects fundamental rights of individual citizens and
restrains state efforts to discriminate against out-of-state citizens.
However, the Privileges and Immunities Clause extends not to all
commercial activity, but only to fundamental rights.
The equal protection clause in Section 1 of 14th Amendment to the U.S Constitution, also limits the degree to which state and local governments may make distinctions based upon state residency or state of origin without a "rational basis" for doing so. This is a low threshold, but often, a distinction based upon state residency wouldn't pass muster even under this deferential standard of review.
The full faith and credit clause in Article IV, Section 1 of the U.S. Constitution requires state and local governments to honor public records and documents from out of state, e.g. marriage certificates.
There are also strict limitations in the U.S. Constitution that regulate the taxation of interstate trade and commerce with tariffs (which are only allowed to cover the costs of inspections at a state border) as set forth in Article I, Section 10 of the U.S. Constitution.
And, in addition to all of these limitations, state and local governments are subject to a judicially created doctrine called the "dormant commerce clause" that prohibits state and local laws that unduly interfere with interstate commerce. These is also a related unwritten constitutional right called the "right to travel."
Finally, the legal theory behind federal diversity jurisdiction (authorized by Article III, Section 2 of the U.S. Constitution) was that there was a real risk that state courts would discriminate against out of state residents in connection with lawsuits in that state's courts.
The government of a small town in Montana directs its police force to
enforce the law more strictly against people from Ohio.
This is probably unconstitutional, notwithstanding the very broad nature of prosecutorial discretion, especially when not linked to any evidence that people from Ohio are more serious violators of the law, But, it would be very challenging to prove absent an admission that this was the policy. This would be mostly a 14th Amendment, Section 1, equal protection analysis, but would be bolstered by privileges and immunities clause considerations.
The Texas legislature decides that Tom McCall's only failing was not
going far enough, and enact a statewide speed limit of 20 mph for all
noncommercial vehicles with California license plates.
This would violate the privileges and immunities clause and the dormant commerce clause. It would also violate the unwritten constitutional right to travel that has been recognized by U.S. Courts.
California responds by making being Texan a felony.
This would clearly be unconstitutional as well, for multiple reasons, including the privileges and immunities clause. The unwritten constitutional right to travel would probably be the most direct route to this conclusion.