ABL's ordination and consecration were both done in a perfectly valid form. For one thing, there were two people assisiting Leinart who were NOT Freemasons, and ABL did not know Leinart was one.
Not at his ordination. It was only Liénart who ordained Lefebvre.
The consecration does not "fix" the issue.
My understanding is that it would actually fix this. The rule and philosophy of the church is that that the minor orders are included in the greater. IE when Our Lord made the apostles bishops, he did not make them priests first, then go on to make them bishops afterwards. When he said "do this in memory of me" they became bishops. Also, it is my understanding that ordinarily it is that the tradition of the church to make a person priest, then bishop, but when the consecration of a bishop takes place, the minors are included in the majors. But perhaps commentary from someone who would know this in more detail would solidify this (Caminus, Gladius, Hobble etc...)
Lastly, yes, being a Freemason would have made Liénart not Catholic, but
not invalid. In the same way the Orthodox are outside the church, but have valid orders, Liénart was outside the church, but his validity remained. Lastly, some would say his intent was not there, however in the tradition of the church, one is to be considered valid until proven otherwise- and no one can prove or disprove Liénart's intent.