As the housing market slumps, few companies are suffering as badly as KB Home ( KBH).

The homebuilder specializes in the Southern and Southwestern markets, where the pain is the worst. It recently reported a $172 million quarterly loss from continuing operations, as sales collapsed by a third. And, as we know, the results are similar across the real estate sector and, now, the mortgage business.

KB Home stock has been in free fall for most of the year, plunging roughly 40% since January, trading recently on Wednesday down 2.5% to $31.01.

Cashing out at the top is nothing new for insiders in the hard-hit homebuilder sector, as investors in Toll Brothers ( TOL) can attest. Combine the problems in that sector with the recent meltdown of mortgage companies exposed to subprime loan defaults and you have a whole lot of pain to go around in the housing industry.

The beating continued for the homebuilders today, as shares of Beazer Homes ( BZH) were punished on rumors that the company was filing for bankruptcy. Beazer called the rumors "scurrilous and unfounded." Beazer fell as much as 42% before recovering, and was recently down 14% to $12.01.

Shares of other homebuilders also were sliding Wednesday. Hovnanian ( HOV) was down 9.3%, to $12, Toll Brothers was down 2.3% to $21.43, and Lennar ( LEN) slid 2.3% to $29.81.

And what's worse than losing a fortune on these shares? Knowing you bought them at the peak of the market -- possibly from the CEO himself.

Let the record show that neither KB Home's current head honcho, Jeff Mezger, nor his predecessor, Bruce Karatz, did anything wrong when they dumped more than $100 million of stock in July 2005. And they certainly weren't the only industry executives who got out while the getting was good.

The fact that the pair sold huge chunks of company stock almost exactly at the peak, and shortly before the housing market collapsed, was doubtless just a coincidence. And the people who bought their shares and have already lost nearly $63 million, or 60 cents on every dollar invested, are just the victims of bad luck.

A KB Home spokeswoman says Mezger still has substantial holdings in the company. She could not comment on Karatz, because he has since retired.

The summer of 2005, of course, turned out to be the peak of a monster real estate bubble. It was one inflated by real estate speculation and eye-watering levels of personal debt. That bubble had sent prices to unsustainable levels. KB Home, one of the country's biggest homebuilders, was right in the sweet spot.

Yet if you look back at the transcript of the company's June 2005 conference call, one thing sticks out: complacency. That's true of the management -- and of Wall Street analysts.

The scribblers are supposedly paid to be critics, not cheerleaders. But none of them pressed the company hard on the possibility of a housing bubble. No one questioned whether the strong metrics, like earnings and inventory, were backward-looking. Most were too busy congratulating the management to ask any awkward questions.

Housing prices were reaching the stratosphere. Most real estate markets were seeing double-digit annual gains.

How distant that era seems now.

Investors today are contemplating a financial world in which most assets, from emerging-market equities to junk bonds to commodities, are at lofty levels compared with any long-term measures.

Sure, the global economy is booming. Sure, earnings are at record levels. Sure, economic conditions look excellent. But the housing market meltdown is a timely reminder that none of that is going to matter if you simply pay too much for an asset in the first place.

Shares of KB Home, for example, touched a peak of $84.20 a share on July 20, 2005. The homebuilder saw its sales double in just three years while its share price more than tripled. In June of that year, the company announced that quarterly earnings soared 67%, and it raised its guidance for the full year.

Yes, some people at the time were pointing out that it was all a massive bubble. They were even saying house prices were wildly overvalued and that in large parts of the country -- especially places like the Southwest, where land was plentiful and cheap -- they were bound to collapse.

Not so Karatz. In June 2005, as his company announced record earnings, he upgraded full-year forecasts and insisted to analysts on the conference call that the future looked bright. "It was a terrific first half," he said. "Our outlook for the year if favorable."

Karatz went on CNBC to dismiss talk of a housing bubble. How long could the "near perfect" market continue, his host asked? "Well, I think it can last a lot longer than the skeptics believe," he replied. Karatz predicted strong demand would continue as new migrants flooded into the booming areas in the South and West. He noted that interest rates remained favorable.

"I think the combination of those two factors make for a very good picture for homebuilders for the foreseeable future," he declared.

For good measure, he also dismissed suggestions that his company, and others, were building too many homes. "We're talking about a relatively small percentage increase over what happened 15 years ago, when our population was much smaller."

Karatz also went to a Reuters real estate conference in New York, and calmed the fears of anyone worried about all the subprime lending and adjustable-rate mortgages behind the market. Most people taking out ARMs are "capable buyers," he told the conference. And of all those using ARMs simply to increase their leverage, he added: "I'm not quick to say it's imprudent."

Ouch.

KB Home shares responded to all the great news, soaring above $80 in July. What's interesting, though, is how Karatz and Mezger, his chief operating officer at the time, were acting. While Wall Street bulls were bidding up their stock, they were taking profits. On July 7 and July 8, 2005, Mezger exercised 369,292 share options and then sold the shares at an average price of around $77. And a week later, Karatz did the same with 950,000 options, getting an average price of just over $80.

Do the math. When you take away the cost of exercising his options in the first place, Mezger walked away with a profit of $23.8 million. If he had waited until today to sell his shares, he would have collected just $7.2 million. As for Karatz, he pocketed $63.6 million. Had he waited until now to sell the shares, the figure would just be $17.6 million.

Wow.

Nice savings.

In the spring and early summer of 2005, the standard line out of the real estate industry and out of Wall Street was that the boom would continue. Demand will continue to surge, went the argument, thanks to low interest rates and a strong economy.

Guess what? Long-term interest rates have stayed pretty low. The economy has remained strong. Employment is up. And, last I checked, people still like to live in good homes.

Yet the market has crashed anyway.

The reason isn't hard to find. House prices were just way too high -- especially when measured against long-term metrics like average household earnings.

Price matters.
In keeping with TSC's editorial policy, Brett Arends doesn't own or short individual stocks. He also doesn't invest in hedge funds or other private investment partnerships.

Arends takes a critical look inside mutual funds and the personal finance industry in a twice-weekly column that ranges from investment advice for the general reader to the industry's latest scoop. Prior to joining TheStreet.com in 2006, he worked for more than two years at the Boston Herald, where he revived the paper's well-known 'On State Street' finance column and was part of a team that won two SABEW awards in 2005. He had previously written for the Daily Telegraph and Daily Mail newspapers in London, the magazine Private Eye, and for Global Agenda, the official magazine of the World Economic Summit in Davos, Switzerland. Arends has also written a book on sports 'futures' betting.