Yes, in general real property can be sold with CC&R violations. As the owner of a property that is in violation of CC&Rs you have the obligation to comply with the CC&Rs. So yes, it would seem that you have the obligation to bring your property into compliance.
However, if those violations were known by the seller before the sale they must be disclosed to the buyer along with any other encumbrances on the property if the sale was made using a standard Utah Real Estate Purchase Contract. If the property was a REO or other foreclosure and sold "as-is with no warranty or disclosures" then you as the buyer should have known to conduct a more detailed inquiry and inspection of the property's condition and encumbrances. The question that needs to be answered is "Was the violation known prior to the sale and was it disclosed by the seller or the seller's agent to you?" Another question is "Did the HOA know of the violation before the sale and did it hold off on sending the seller a notice of the violation to assist the seller in selling the home?
If the seller or seller's real estate agent knew of the violation and failed to disclose it then you most likely have a cause of action against the seller and may have an cause of action against the seller's agent if that agent was aware of the violation. Did you have a home inspection performed and was the violation something that a home inspector should have found? There may be another party from which recovery of costs could be sought. Also, if the HOA was complicit in not communicating the violation until after the sale it too could be another party that could contribute to the cost of the repairs.
While it would appear that you have the obligation to comply with the CC&Rs, more facts are needed to understand when the HOA, seller and seller's agent were aware of the violation. An inquiry to the HOA regarding compliance with the HOA's CC&Rs and related rules is something that should have been done during the inspection period before finalizing the purchase of the home.
This information is for discussion purposes only and does not constitute legal advice nor does it establish an attorney-client relationship. Individuals seeking a legal opinion or legal advice on any matter should contact an attorney experienced in the field of their issue and discuss retaining such attorney to represent the individual.