If you remember, the Courtney Lee for Jerryd Bayless trade was agreed upon a least a day before it was finalized. The inclusion of the Thunder was a late development. In fact, it had many people scratching their heads about why they were involved at all. The Griz had a trade exception that they could use from the Rudy Gay trade and didn't really need to match salaries to make it work. The 2nd rounder was rumored to be going to them well before the Thunder got involved.
So why would the teams agree to involve the Thunder?
As they say, follow the money.
A footnote relating to the Boston Celtics-Memphis Grizzlies-Oklahoma City Thunder trade that was completed earlier this week: the Grizzlies didn't just get shooting guard Courtney Lee and a 2016 second-round pick (via the Celtics), they were also given $1.1 million from the Thunder that must be paid within 30 business days.
It cost the Celtics nothing to accept Ryan Gomes in the trade because his contract wasn't guaranteed yet. The Grizzlies, though, were picking up more long term money to have to pay Courtney Lee and they aren't in the largest market. So ever million counts sometimes.
The Thunder wanted to create some cap room for future trades and picked up a 2nd rounder in the process.
So there you have it. All the loose ends tied up.