“I tried to rationalize bond market and understanding why would someone put their money in long term treasury when it pays less than short term while dollar is depreciating like Titanic.”
Some market participants don’t care. For example, let’s say I go to an insurance company and buy an annuity. They then take that money and put it into long term bonds and make a spread between what I agreed to accept an what they are earning in the bond market. They don’t care about currency fluctuations since they aren’t converting out of USD when they pay me back. They also don’t care too much about how much more they could be making in a riskier asset such as stocks because they have committed to a fixed payout. If their investments come up short it hurts a lot.
This is called duration matching and it’s a really big part of why wall street securitizes mortgages the way they do (basically the demand from insurance and pension funds for AAA rated long term debt, coupled with the low supply of actual AAA rated long term debt. This creates a price gap that you can make money on if you can come up with a way to create AAA debt out of other things)