When the rules of cantus firmus were established there was no concept of triads and harmonic functions.
So this rule is correct for the time it has been developed.
One point is that cantus firmus was concerning especially church songs and there were only male voices and two leaps in the same direction or more would have been leading to the limit of the voice of the munchs.
Don't focus your study on the rules but on what you are learning by accepting and training them:
to form your inner ear
to learn something about history of music
to detect the problems of notation of music
and enjoy that there has been a developement in music and you don't have to respect them anymore today.
Keep your critical mind and continue "asking holes in the stomach" (as we say in German) what means: pester your teachers with questions!
I hope this link may help you further:
any large leaps (fourth or larger) are followed by step in opposite direction
no more than two leaps in a row; no consecutive leaps in the same direction (Fux’s F-major cantus is an exception, where the back-to-back descending leaps outline a consonant triad.)
The characteristics listed above are fairly detailed, and some of them are specific to strict species counterpoint. However, taken together, they express in detail some general tendencies of melodies in a variety of styles.
David Huron identifies five general properties of melodies in Western music that connect to the basic principles of perception and cognition listed above, but play out in slightly different specific ways in musical styles.
To respond your question below in the comments to this answer:
Mind that through hundreds of years of theory, analyzing and teaching it is absolutely normal that there are different meanings about any rules of composition.
Mind that music is not an exact science and many phenomena that were considered as natural or given by God had been cultural and created by men.
Mind that the rules usually have been formed by theoreticians years after others had been composing in a certain style. And those theoreticians were not the greatest musicians of their time. Otherwise they would have written music instead of theoretical rules.
But there was Zarlino, Dux, Schönberg, Hindemith and many others who collected the rules, analyzed the music by others, broke earlier rules and postulated new ones.
Books of today teach often summary and a mix of rules postulating a style in which nobody ever has written.
Also Geometry’s, Physics and Mathematics have been revolved and the greatest genies have always been the rebels and the revolutionary of their epoques.
But which rule out of the two cited rules is correct? They seem to be contradicting each other...
You have found an interesting point that shows that some rules can be opposite or divergent.
In the following article they rules are categorized as:
AR = absolute rules, all the authors agree (some may not express judgement).
MR = majority rules, not all the authors share the same opinion.
UR = undefined rules, the rule is not clearly formulated and requires interpretation.
IR = implicit rules, the rule implicitly operates in the literature.
(I hope you‘ll enjoy reading as I did.)