The dividing line here is our understanding of what, exactly, "the church" is. Because I certainly don't suppose that the gates of hell prevailed against it, but that is not to say that the clergy was not thoroughly corrupt and worldly.
That's a broad statement. I'm sure there were plenty of good and spiritual clergy, the best, whether clergy or laity, occasionally being recognized as saints due to their authentic godliness. There also were certainly a multitude of worldly ones. The church had, within a fragmented and politically divided Europe, continuously spoke against this corruption at least since the first Lateran councils, for many centuries IOW. But the mediaeval values were far from Christlike for many, where pomp and ceremony and benefices and nepotism and avarice, etc, instead ruled the day.
As for what sola fide is by nature, that seems to vary from person claiming it to person claiming it. Within the orthodoxy that developed from the reformers it was never treated as if it were a doctrine in a vacuum, so overcoming sin and doing good after justification was always treated as a part of the picture. It simply wasn't given merit for the one doing the good deeds, because the good that flows from justification is alien in the same way the justification itself is alien. Though here I'm speaking for a doctrine I don't agree with, because it is often mischaracterized by critics rather than letting those who espouse it define it for themselves.
The confusion with SF begins because with it man is said to be justified...
without being justified. He's imputed or declared to be just IOW, and if this is the case then there would be no
change, no reason or ability for him to be any
better than he was beforehand. In the historic teachings, man is forgiven of sin, washed, cleansed, made a new creation, a child of God with the Holy Spirit now indwelling. He possesses a foreign righteousness (that comes from God on the basis of faith, Phil 3:9) but it's foreign only because he possesses
none, in his fallen state, apart from God. Faith is the reestablishment of union with Him-and that union, itself, is the very essence of man's righteousness. And man's unrighteousness or sinfulness was originally foreign as well, as nothing or no one in creation was created to sin.
The point: man was created for communion with God; apart from Him man
has no justice or righteousness. Man is lost and cannot find himself; for that God must reach down; grace is essential. But man willfully fell and to the extent possible, with the help of grace while not totally overwhelming us with it, God wants us to willfully rise, to say "yes" instead of "no", and to say "yes" daily and to confirm and strengthen that "yes" throughout our lives. Then, at the end, He judges how we've done with what He's given us. Again, we can always say "no", and turn and walk back away.
If justice is merely imputed instead of given, then there's no real justice to
lose, and therefore no way to lose salvation.,.apparently? That's where the confusion and differing understandings of the outworkings of Sola Fide enters in, and that's why the church has historically taught that while man is freely justified, that justice is
real, not vicarious, from God, and can be compromised and forfeited-by living
unjustly, failing to remain in Him.