Based on the International Building Code (IRC), installation of a water heater in an attic is permitted for as long as this installation meets certain requirements. You can follow this link -
Water heaters shall be installed in accordance with the manufacturer's installation instructions and the requirements of this code. Water heaters installed in an attic shall conform to the requirements of Section M1305.1.3. Gas-fired water heaters shall conform to the requirements in Chapter 24. Domestic electric water heaters shall conform to UL 174 or UL 1453. Commercial electric water heaters shall conform to UL 1453. Oiled-fired water heaters shall conform to UL 732.
M1305.1.3 Appliances in attics.
Attics containing appliances shall be provided with an opening and a clear and unobstructed passageway large enough to allow removal of the largestappliance, but not less than 30 inches (762 mm) high and 22 inches (559 mm) wide and not more than 20 feet (6096 mm) long measured along the centerline of the passageway from the opening to the appliance.
The passageway shall have continuous solid flooring in accordance with Chapter 5 not less than 24 inches (610 mm) wide. A level service space at least 30 inches (762 mm) deep and 30 inches (762 mm) wide shall be present along all sides of the appliance where access is required. The clear access opening dimensions shall be a minimum of 20 inches by 30 inches (508 mm by 762 mm), and large enough to allow removal of the largest appliance.
1. The passageway and level service space are not required where the appliance can be serviced and removed through the required opening.
2. Where the passageway is unobstructed and not less than 6 feet (1829 mm) high and 22 inches (559 mm) wide for its entire length, the passageway shall be not more than 50 feet (15 250 mm) long.
P2801.5 Required pan.
Where water heaters or hot water storage tanks are installed in locations where leakage of the tanks or connections will cause damage, the tank or water heater shall be installed in a galvanized steel pan having a material thickness of not less than 0.0236 inch (0.6010 mm) (No. 24 gage), or other pans approved for such use. Listed pans shall comply with CSA LC3.
P2801.5.1 Pan size and drain.
The pan shall be not less than 11/2 inches (38 mm) deep and shall be of sufficient size and shape to receive all dripping or condensate from the tank or water heater. The pan shall be drained by an indirect waste pipe having a minimum diameter of 3/4 inch (19 mm). Piping for safety pan drains shall be of those materials listed in Table P2905.5.
P2801.5.2 Pan drain termination.
The pan drain shall extend full-size and terminate over a suitably located indirect waste receptor or shall extend to the exterior of the building and terminate not less than 6 inches (152 mm) and not more than 24 inches (610 mm) above the adjacent ground surface.
So, the reason for your local utility company request to relocate this water heater could be hidden behind the building code that has been adopted in your particular area and it slightly varies from the IRC for 1&2 family buildings and IPC.
Other reason could be the size of your property (more than two units) and specific building code that applies for such buildings.
Another one is that there are some violations in your attic water heater installation and they cannot be corrected (or easily corrected) in that location (venting, combustion air, clearances, etc.), therefore, the utility company decided that the only solution is to move the water heater installation into the basement.
Usually they (gas company) list all of the existing violations on the ticket so they can be verified by a professional and corrected. I’d suggest consulting a licensed plumbing contractor or visiting your local building department for a list of regulations that apply this specific condition in your area.