They also freed up $18.5M of cash (which, as Yogi Berra says, is just like real money).
The Kings had a choice of paying out $18.5M to players they were going to cut while also taking a cap hit for the next five years, or giving up two pick swaps and a first-round pick. They chose to "sell" that first-round pick (and the swaps, and Stauskas) for $18.5M and some additional cap flexibility. Salary floor rules meant that Philly effectively paid less than that (when all is said and done the Kings actually "stole" that money from Philly's players, which is an interesting trick), but from the Kings' side that's not really a terrible bargain. Now, what they did with that $18.5M and the cap flexibility didn't work, but that doesn't mean they didn't understand the rules. That $18.5M is effectively what they paid Marco Belinelli ($19M/3). Now, Belinelli didn't work out, but they obviously thought he would, and while without the trade they could have used the rules differently to get the cap space to sign him, that wouldn't have helped them have the CASH to sign him, since they would be paying that money to players they had waived instead.
In short, the Kings sold a first round pick for a lot of money. Then they screwed up with what they spent the money on. But these are two separate transactions.