Aggregation of salaries makes a lot of sense in a salary capped league. Normally, who really cares if a team has 2 players making $15M each or one making $30M; letting teams trade one the former for the latter, and vice versa, is therefore allowed in most cases.
The intention of the second apron is to prevent teams above the apron from easily acquiring a high-salaried player. So, yes, teams can spend as much over the soft cap as they want, but they will find it more difficult to build a super team if they do so.
Allowing teams above the apron to swap out the higher salary for multiple lower-priced players is a way to allow big money teams (aka those above the apron) to trade superstars, and thereby further promote parity. It was also a compromise to allow the big market teams to have a way to get below the apron; it's then easier for the team to trade the lower-priced players for draft picks or similar to get below the apron.
Not sure the 2nd apron thing was necessary, to be honest. But the CBA is the result of the collaboration of multiple stakeholders, and has served the league and its players and owners well over the decades.