The original thinking behind the law is exactly as you put it ... to allow a small business to invest in its early days, take initial losses and continue to sustain itself through to eventual profitability.
However, Trump's M.O. is different: take on a large amount of debt ("other people's money / OPM" as he calls it), file for bankruptcy, screw over the creditors who lent you money and the contractors who supplied you, take the loss on your books and then use it to avoid taxes on future income.
So a law that aims to reward risk-taking and entrepreneurship is instead being used by the likes of Trump to reward debt. No wonder he likes to call himself the "king of debt". And the punchline to this sad joke is his tweet from 4 years ago: