Let's take a look at the run down of the numbers done by ZDNet, who has analyzed the case quite thoroughly.
Upon purchasing Motorola for $12.5 billion, Google received $2.9 billion in cash from Motorola. Soon afterwards, Google offloaded Motorola Home, Motorola's set-top box division, along with some patents to Arris Group for $2.35 billion. Motorola's patent portfolio (mind you, there are well over 24,000 patents) is valued at a rather conservative price of $5.5 billion. After doing some subtracting and taking the $2.9 billion Lenovo paid Google into account, Google has actually made roughly $1.1 billion as a result of this seemingly irrational selling price. This also means Google paid less than $4 billion for Motorola’s entire patent portfolio after the sale. In fact, Google's gains from Motorola are much grater than this monetary value.
First off, by keeping the vast majority of Motorola's patents, Google is forever equipped with a shield of protection against future lawsuits. In the increasingly competitive and patent-war driven smart phone market, having a reservoir of patents to retaliate against litigations when needed is highly useful. Secondly, Google has chose the right timing to execute the sale. Given that the company reported fourth quarter earnings couple weeks back before the sale took place, it dodged the responsibility to mention hardware profit margins and whether the smartphone unit was profitable.
Despite selling Motorola at 1/4 of the price it was purchased, Google still managed to make a billion dollar return off of it. Well played once again, Google.

