Investors, at least the smart ones, are not primarily interested in profits.
They are interested in growth. A company that has zero growth potential and a stable profit paid in dividends can be far less attractive than a company posting losses with massive potential growth potential. Especially when capital gains taxes are a factor as they are in the US.
This is not always the case depending on your circumstances but most often is.
Remember the finance 101 law that states share price increases are always better than dividends because with share increases you can choose to sell some of your shares and get the same effect as dividends should you want it.
Also remember that, theoretically, share price is a combination of current company value with future growth potential and risk factored in. (hence why most stocks are valued far in excess of their book value) Risk is mitigated by investors across their portfolios (unless they are idiots) and in fact they would WANT them to take risks for the potential gains.
So yes, government and company books are nothing like personal accounts.
With government books it is wise to save during booms and spend like crazy during crashes to help smooth the economic cycle and prevent depressions. Completely counter intuitive to personal spending.