The costs of construction include not only the cost of materials, competent workmen to install the roof and the decking required to a particular design, but the costs based on its design and execution, throughout the life of the roof, called life-cycle costs. Indeed, the length of the life cycle, the service life, is a major consideration, a roof that lasts two weeks is useless on a building that will stand for years. The cost of maintenance, not directly a life-cycle cost, is a design consideration as well.
Environmental factors, like snow and wind loads, are directly related to another factor, the local climate. Where snow and wind loading capacities are generally specified in building codes, the physical requirements for those loads may surpass the minimums required by law, affecting both the design and construction of the roof. Other factors, like the opportunity to add "green" systems, like skylights and solar heating, give a direct financial benefit to the building owners, through tax credits.
Local building codes, like the Southern States Building Code, and its local variations dictate the minimum construction and design standards, as a matter of law.
Residential or commercial, a home, an office, a bank or a museum, each has different needs in a roof. The bank might need a high-security design, the museum one that will withstand an environmental cataclysm, whereas a home might need "just a roof."