the difference as I see it (and just my opinion) is that in deal #1 (no cash) all the money is "spent" and can't be converted to something else.
Sure, the $5M player may not be "worth" $5M in talent, but cash (in the past) has been traded for a contract, and somebody will be spending budget for the contract.
In the cash deal, the team getting the $7M player doesn't have the budget to acquire a $7M contract, so he needs cash from somebody else's budget. And the person giving the cash has $5M sitting around that may or may not get used by season end. In the hands of the person giving it up, it hasn't yet become the type of asset that can generate HBD wins, but packaging it with a $7M contract lets someone who couldn't otherwise "afford" the $7M contract aquire it.
maybe I didn't explain that very well and maybe the "explanation" doesn't create a distinction of any import to a lot of people, but that is why I personally think the first deal is OK but not the 2nd.