Yes. A son in the Church was sort of a hot-swappable backup, as the Church would cut him loose if you had a good reason, such as the primary heir having died (and, of course, subject to the payment of a ...modest donation...), but while he was in the Church he was no threat to the primary. Any children he himself had (this was far from unheard of) would be automatically be illegitimate and not in the line of succession.
Extra sons were, yep, often sent off to war. They'd either conquer their own territories or be killed. In either case, they were no longer a threat to the primary heir.
The first son would inherit the family assets. Second son would join clergy. The third son would be sent off to join a knight's group such as the Knights of St. John.
Inherit, clergy or war.