I'm going to avoid going too deep into the technical on this.
In short, Canada's tax system is set up under the theory of 'integration', which means that an individual should have no tax benefit, and no tax penalty, whether or not their income is earned through a corporation, or whether it is earned directly by the person.
In order to enact this theoretical goal, the Income Tax Act contains many provisions to close 'loopholes' that would otherwise provide tax benefit or penalty to corporations.
First, the hypothetical ideal of an integrated tax system:
If corporate taxes are 30%, and personal tax rates are 45%, then by the time I receive income personally [either directly as an owner of a non-incorporated business, or through dividends received through my corporation as a shareholder of an incorporated business], the total tax paid on that income stream should be 45%. If the total taxes paid are > 45%, then I have suffered a loss by incorporating my business; if the total taxes paid are < 45%, then I have earned a gain by incorporating my business. Neither of them are ideal under the goal of integration.
So in theory, the corporation should pay 30% tax on its earnings, and then I as the shareholder should pay an additional 15% tax on the dividends I receive from the corporation. [This is why dividends in Canada have a lower tax result than other income types - to anticipate corporate taxes otherwise payable]. Total taxes paid = 45%. Success!
But, a system so simplified creates many loopholes. One example is the situation you have raised in your question: what if I have a $10M estate, and I earn 7% = $700k in income annually. If I had no corporation, then I would pay 45% tax. If I hold the investments in a corporation, then I would pay only 30% tax, until maybe 40 years down the road when I actually need to receive dividends from the corporation [because perhaps I have no need for this extra money - it is my retirement 'nest egg' only]. So I would have greatly deferred my tax liability. This means I have received a tax benefit from incorporating, which is opposed to the goal of integration.
How does the government attempt to close this particular loophole? Additional Refundable Taxes. In short, the additional tax rate paid by the corporation is refunded to it, when it pays dividends to the shareholders. This means that investment income is immediately taxed at the 'top marginal rate', until it is paid out as dividends, at which point the corporate tax amount is lowered, and the shareholder ultimately pays personal taxes bringing the total back up to where it would have been, if they earned the investment income personally.
This creates the result you see in your question.
Why doesn't the government apply the same principle to 'active business income'? Because the government specifically wants to allow you to defer taxes on active business income. This is an attempt to promote economic activity, small business growth, employment, all of those types of things. It means that if your business earns $100k, and you only take a $40k salary, and you reinvest that extra $60k in the business, you have increased economic output, which is good for various reasons. Whether this goal is 'correct' or not, is not a part of this answer.
Remember that tax laws are complex, and the direct outcome of a specific circumstance may or may not match the original intent of the laws. The better the tax system, the more frequently specific outcomes match the original intent.