The end of parshas Balak is the sin at Shitim with the Bnos Moav, culminating in the sin of Zimri and Cozbi. Pinchas kills them both, stopping the plague. That would have been a good place to stop, but the last verse says (Numbers 25:9):
וַיִּהְי֕וּ הַמֵּתִ֖ים בַּמַּגֵּפָ֑ה אַרְבָּעָ֥ה וְעֶשְׂרִ֖ים אָֽלֶף׃
Those who died of the plague numbered twenty-four thousand.
That's a rather depressing note. The Rema in OC 138:1 says:
. וִיכַוֵּן שֶׁיַּתְחִיל תָּמִיד לִקְרֹא בְּדָבָר טוֹב, וִיסַיֵּם בְּדָבָר טוֹב
And one should aim to always begin to read on a good matter and to end on a good matter
Why does the parsha end in a way that doesn't fit this halacha? Better yet, stop before the whole story with Shittim. I must admit I haven't checked this Rema against every aliyah in the Torah, and for all I know there are other counter examples, but this one is pretty striking. Now I wonder if someone would argue that it's good the sinners died, but I think it's pretty bad that the sinning got to such a level that that many died.