Why do bitcoin mining companies sell hardware if the hardware they are selling makes them money? Why do bitcoin mining companies sell hardware and make ASICS if the hardware they are selling makes them money? Surely they would hold onto the profitable hardware and sell it when it's less profitable?

Does this actually happen?
http://arstechnica.com/gadgets/2013/06/how-a-total-n00b-mined-700-in-bitcoins/3/

In fact, if it's so profitable, why on earth is Butterfly Labs selling these devices? Why not rent a warehouse, fill it with miners, and make infinity bitcoins?
The answer is two-fold. First, BFL required a great deal of capital in order to design and manufacture the ASICs that power its boxes and then to assemble the miners themselves. This capital was provided in no small part by pre-selling the miners; hanging onto them to do some BTC mining with them is sketchy at best and at worst illegal. Plus, there are practical considerations: a giant BTC warehouse adds overhead costs, and I can't even begin to take a guess at the bookkeeping implications of warehousing capital like that.
However, the second reason is far more practical: bitcoins, for all their current value, are still speculative. A large amount of US dollars is a large amount of US dollars no matter which way you cut it. It can be readily exchanged for goods and services. Bitcoins themselves don't necessarily hold value, and it's difficult to exchange them in large quantities for an equivalent amount of dollars. So selling Bitcoin miners for dollars guarantees a certain number of dollars; investing capital into mining a truly large number of bitcoins might work well as a short-term hedge, but the value of the trade is utterly impossible to predict.
This, I suppose, is part of the nature of high-risk investments. But in this case, Butterfly Labs can simply charge whatever it wants for its gear in order to make whatever margin it deems is sufficient. Why bet on the future of a relatively new virtual currency that may go up or down when you can simply get a bunch of real US dollars?