Masonry structures have been widely used around the world because of their low cost and simplicity of construction. In particular, unreinforced masonry (URM) structures represent a high percentage of the residential building stock in the central and eastern United States. Unfortunately, many URM buildings are brittle and have a severe failure mode under seismic loads. Although it is urgent to retrofit the existing housing stock, resources are limited, and it is not practical to retrofit all URM buildings in one area. This study aims to examine the proof of concept of optimal resource allocation for retrofitting URM structures based on variables that directly influence damage costs, such as the priority of the building, size of the building, and cost constraints. To this end, a novel model based on the Conditional Value at Risk (CVaR) was developed through a genetic algorithm and validated under three CVAR scenarios. The findings revealed that this model could be used to prioritize buildings such as hospitals and schools based on importance and vulnerabilities. This research should help the decision-makers optimally allocate money to retrofit buildings in a disaster-prone area before the next earthquake occurs.