Can US states forbid someone from candidating to a party presidential
candidature?
Yes.
A candidate can be excluded from a state primary ballot for not being qualified to hold the office that the primary ballot concerns.
¶54 No party in this case has challenged the Secretary’s authority to
require a presidential primary candidate to confirm on the required
statement-of-intent form that he or she meets the Article II
requirements of age, residency, and citizenship, and to further attest
that he or she “meet[s] all qualifications for the office prescribed
by law.” Moreover, several courts have expressly upheld states’
ability to exclude constitutionally ineligible candidates from their
presidential ballots. See id. (upholding California’s refusal to
place a twenty-seven-year-old candidate on the presidential ballot);
Hassan v. Colorado, 495 F. App’x 947, 948–49 (10th Cir. 2012) (affirming the Secretary’s decision to exclude a naturalized citizen
from the presidential ballot); Socialist Workers Party of Ill. v.
Ogilvie, 357 F. Supp. 32 109, 113 (N.D. Ill. 1972) (per curiam)
(affirming Illinois’s exclusion of a thirty-one year-old candidate
from the presidential ballot).
¶55 As then-Judge Gorsuch recognized in Hassan, it is “a state’s
legitimate interest in protecting the integrity and practical
functioning of the political process” that “permits it to exclude from
the ballot candidates who are constitutionally prohibited from
assuming office.” 495 F. App’x at 948.
From the 133 page per curiam opinion in Anderson v. Griswold (the Colorado case keeping former President Trump off Colorado's Republican primary ballot) citing a U.S. Court of Appeals decision reaching this conclusion written by a judge later promoted to the U.S. Supreme Court.
The quoted material is a highlight, but the opinion explains this at greater depth. This issue was not even very controversial in the case.
Why Do States Have This Authority?
There are at least a couple of hooks for court's to have a say on this issue:
- States have broad discretion to determine how candidates are nominated for general election ballot positions, so long as minor parties and independent candidates aren't entirely kept off the ballot.
Because political parties exist in the U.S. primarily to place candidates on general election ballots, they are subject to regulation by the governments that administer the general elections in a way that other private organizations which want to express political ideas but not propose candidates for governmental elected offices are.
Most states have a Presidential primary, because turnout is typically 10x or more greater in a primary than a caucus which takes less time to participate in. Some states have political party caucuses. But, ultimately, it is for the state and not the political parties to decide what hoops a political party must go through if it wants its candidates to appear on state general election ballots. Some states even require political parties to allow unaffiliated voters to vote in their process to select their nominee, at least in the two major political parties to be eligible for a spot on the ballot. Colorado is such a state.
- A primary is an election of a party's nominee for an office that is administered and paid for by the government, rather than the political party involved. If the state does not administer or pay for the political party's selection process, it is called a "caucus" instead. When the state administers and pays for an election, even an intra-party election, this, in and of itself, it sufficient to authorize states to require that candidates be qualified to hold the office.
Presidential primaries are a bit different. In all other races, the entire nomination and election process is administered by a single state.
Presidential primaries and caucuses of a political party choose a slate of delegates to the national convention of the political party, sometime in the summer of the Presidential election year, and the committee of political party officials on the credentials committee of the national convention can decide whether or not the nominees of a state's delegate selection process mandated by state law will be accepted as valid. The National Convention with delegates from all 50 states and also from jurisdictions that don't have a say in the actual Presidential general election choose a party nominee. That nominee is then presented to election officials in all 50 states and the District of Columbia seeking ballot access. This can be denied to a candidate that isn't qualified to hold office, and strictly speaking it is not the nominee but a slate of electors pledged to the nominee who appear on the ballot. But, since state law (and often political party rules) require that nominees at both stages of the process be qualified to serve in the post to which they are nominated, a failure to be qualified to serve is a gross barrier to that person becoming a nominee.
About U.S. political parties
As an aside, the U.S. has extremely weak political parties by international standards, and this is by design, as a reaction to what was perceived a corruption in political parties during the Progressive era of the late 1800s and early 1900s, by "political machines" often organized to secure immigrant votes.
The leaders of U.S. political parties can't veto candidates running under their banner, and can't regulate who becomes a member of the party for primary and caucus election purposes. Campaign finance laws strongly favor candidate centered campaign funding operations over political party centered campaign funding operations. Political parties have only weak means to enforce party discipline among their own elected officials. Many U.S. political offices (including state legislators in Nebraska and many local government officials) are non-partisan. Political parties have very few resources to develop policy by means other than votes of its members, or to take direct action apart from trying to get officials from its party elected.