Although I usually write about investments and money from a libertarian perspective, it is good every once in a while to talk about debt. Debt and investments are not mutually exclusive things. You are making an investment decision if you have extra money and you are not using it to pay down your debt.
Of course, there are many different kinds of debt. Mortgage debt is not necessarily bad debt, while credit card debt is bad under most circumstances. Credit card debt should be aggressively paid down if you have it. With mortgage debt, there are pros and cons to paying it down.
If you have credit card debt that you are not paying off each month, then it is almost foolish of you to be investing money. It really doesn't even make sense to have an emergency fund. If you pay down your credit card debt while leaving little money in the bank, you can at least go back to using your credit card in an emergency situation and you will be no worse off than if you had kept the money in the bank.
If you have credit card debt with an interest rate of 18%, why would you even think about investing? How are you going to find a guaranteed return of 18%? Even if your interest rate is 10%, how could you match that with investing?
Some will argue that the one exception is a 401k where your employer is contributing matching funds. You might be able to get a 50% or 100% return on the money you contribute. This is a possible exception, but even here my individual choice would be to not contribute to the 401k and use that money to pay down the credit card debt. You can start contributing once all of your high interest debt is paid off. Money going into a 401k plan is not liquid.
Other debt like car loans are a little trickier. If you have a low interest rate like 2.9%, then I don't really see a problem in investing extra money, as long as you know what you are doing. However, if you are taking all of your money and betting on one stock, I think it would be a better choice to pay down the car debt, even at 2.9%. If you are taking your money and putting it in a money market fund that earns .1% interest, then you should definitely be paying down your car loan instead. The only reason not to pay down the loan in this situation is if you might need that money for an immediate emergency.
I have actually heard people ask if they should take out extra student loans so that they can invest the money. You should absolutely never borrow money for an investment, unless it is for investment real estate where you know you can generate positive cash flow.
In knowing and reading many other libertarians, I have also seen the argument that it is acceptable to take on debt because you can just pay it off in depreciated money after we have severe inflation. While this might turn out to be correct, it also may not. You cannot predict Federal Reserve policy in the future. You cannot predict what hundreds of millions of people are going to do. Perhaps unemployment will get worse and people will become so fearful that they dramatically cut back on their personal spending. In this scenario, we could actually see prices decline. In addition, even if there was massive inflation, it will be prices that will go up. Your income will probably not keep pace, so don't think that it will be necessarily easier to pay off your debts.
In conclusion, when you are investing, you should consider all of your circumstances. If you are in debt, particularly with credit card debt, then don't direct any of your money to investing. Get out of debt first and then you can start investing your money.