It is legal in that there is no law requiring a builder to sell homes to any particular person, and no right or guaranty to be able to buy a home from a given builder. A builder may put conditions on purchasing a home from them, such as that you have to use their lender. If you don't comply with their conditions, they do not have to sell to you.