Note throughout that there are two only-partly related issues: literal correctness, and "importance", and that the latter is tangled up with "status" and "relative prestige" of journals. And, don't forget, all journals get far more excellent papers than they can fit into their "pages", so they will reject many excellent ones, for essentially random reasons... because, looked at bluntly, the job of an editor is to reject papers (not to accept).
It is also the job of editors to maintain or enhance the reputation of their journal, while the real reason mathematicians "need" to publish is to maintain or enhance their reputation, and there's a delicate dance done to see who benefits and who "sacrifices", reputation-wise. In that context, I'd tend to bet that confessing prior rejection wouldn't help anything at all, since it resembles telling someone that you didn't really want to go with them to the prom, but you'd already asked other people and were refused.
In that context, I think one should decline to referee a paper a second time for a different journal, if only on the principle that it might be that one gives a negative opinion for (accidentally) subjective reasons, e.g., that the author's priorities are not what they ought to be. One may truly believe this, but declaring that the author should have written a different paper entirely is a hard objection to meet. If the objections are arguably "objective", that there're serious tangible errors, mistatements of fact, disregard of prior art, etc., that's of course a different matter, but I think these pseudo-objective concerns are not the usual watershed for publication-or-not. It's status/reputation.