For a healthy issuer, longer maturities carry wider spreads because there is more time for things to go wrong. The slope is the credit market's version of the yield-curve and it steepens when investors are comfortable and flattens when they are not.
An inverted credit curve, where short-dated bonds trade wider than long-dated ones, means the market sees a near-term liquidity or refinancing event. At that point the short bonds are the risky ones, because survival past the next maturity wall is the binary question.
Example: an issuer's 2-year trades at 240 basis points and its 10-year at 310, a normal 70 basis point slope. After a covenant breach the 2-year widens to 900 while the 10-year goes to 700, an inversion signalling imminent refinancing risk.
Related: credit-spread-bonds, yield-curve, distressed-debt, default, credit-cycle