The idea is that the trees planted will provide benefits that far exceed the costs of pruning or sidewalk repair. These costs can also be minimized with proper species selection, though in my experience HOAs typically lack the expertise to make good decisions on that topic.
This study found that for every dollar spent on tree installation, maintenance, repairs, etc, $5 of public value was returned. Seems like a good investment! https://www.fs.usda.gov/psw/publications/mcpherson/psw_2016_mcpherson004.pdf
Unfortunately, the benefits of trees are often intangible and dispersed across the community, while the costs can be more immediately felt in some cases. Ideally, your town’s urban forestry program should bear these costs so that they can be more evenly distributed like the benefits, but the political environment in some areas does not always allow for enough budget.