I'm guessing goodwill is taxed differently than capital gains or profits.
Goodwill, in the accounting sense, is an asset, while capital gains and profits are items in the income statement, so they will be taxed differently (taxes, for the most part, are levied on profits.) IIRC, accounting rules concerning goodwill are largely concerned with ensuring it doesn't then distort taxation (e.g. by being amortized as an expense over time).
As tommyrot notes, the item is an accounting necessity, because accounts carry thebook value of assets (non-investment assets at least, and possibly even them), but this differs from the market value. Take tommyrot's example. The $1m is the price of everything the purchased company owns, that can be measured and priced. It's most akin to what you'd get if you broke up the company and sold all its equipment, property, investments etc (and paid off its liabilities, of course).. However, if the company's making decent use of its assets, it's worth more as a going concern. There are intangibles, like the way they've organized those assets, their customer base and so on. Therefore, the buying company is willing to shell out an extra $200k over the book value for all that good stuff.
Now it has an accounting problem. It's got another million in assets that it can put in its books. However, it's paid out $1.2m. That's a $200k hole in the books there. The iron law (such as it is) of double entry accounting is that everything has to balance; therefore, that $200k needs to go in as something. It doesnt make sense to call it a loss, and that'd give the company an unwarranted tax break. So, it's entered as an asset called goodwill.
Why call it goodwill? Recall that it arises because a company has intangible assets, one of the major ones being that its customers are already willing to buy from it. For instance, Kraft bought Cadbury last year. Cadbury was worth a lot more than its book assets, because it's a popular brand - it has a lot of goodwill from its customers. Goodwill towards a company has value, and that value is a key driver of the difference between a company's book value and its market value.