The most common form is a restraint on alienation. Some partial restraints may be valid so long as they leave a substantially large class of potential purchasers, but total restraints such as this one are always void. If a CP is void, the entire interest fails. Thus, considering the preference for a vesting contruction, court might apply an evidential uncertainty test to find the condition valid. X grants to A and his heirs on condition that he remain a bachelor.
Main issue is public policy.
A condition may be void if it clashes with important social values. Conditions inciting commission of illegal acts, encouraging separation of married people, interfering with parental obligations or imposing racial restrictions are usually void as against public policy. It is not generally against public policy to require a person not to marry. This condition does not encourage separation of a married couple, rather it prevents A from marrying, therefore it is probably not void as against public policy. Argue both sides.