Legal base for "any male baptized Catholic is eligible to be elected Pope" A lot of sources (e.g. Wikipedia) mention the fact that "any male baptized Catholic is eligible" to become Pope. I'd like to find the canon law (if any) that states this fact.
Canon 332 states that If the person elected [to be Pope] lacks episcopal character, however, he is to be ordained a bishop immediately. So I would take this to mean that a person, in order to be eligible to become Pope, MUST be eligible to become bishop, but Canon 378 states that, to be eligible to become bishop, one must have been ordained a priest. Doesn't this contradict the "any male baptized Catholic can be elected Pope" statement?
What is the legal base for “any male baptized Catholic is eligible to be elected Pope?”

There are a large number of sources that state that "any male baptized Catholic is eligible" to become Pope, yet Canon Law itself is seemingly silent on this fact. Wikipedia for example states the following:


  The pope does not need to be a Cardinal Elector or indeed a Cardinal; however, since the pope is the Bishop of Rome, only those who can be ordained a bishop can be elected, which means that any male baptized Catholic is eligible. The last to be elected when not yet a bishop was Pope Gregory XVI in 1831, and the last to be elected when not even a priest was Pope Leo X in 1513, and the last to be elected when not a cardinal was Pope Urban VI in 1378. If someone who is not a bishop is elected, he must be given episcopal ordination before the election is announced to the people.


The Catholic Encyclopedia states the following:


  Though since Urban VI (1378-89) none but a cardinal has been elected pope, no law reserves to the cardinals alone this right. Strictly speaking, any male Christian who has reached the use of reason can be chosen.


Thus it should be note that technically any baptized male can be elected Pope.

The Code of Canon Law (1983) states:


  Can. 332 §1. The Roman Pontiff obtains full and supreme power in the Church by his acceptance of legitimate election together with episcopal consecration. Therefore, a person elected to the supreme pontificate who is marked with episcopal character obtains this power from the moment of acceptance. If the person elected lacks episcopal character, however, he is to be ordained a bishop immediately.


One who is not yet a bishop (and the Church has elected several non-bishops to the papacy) can accept the election, but must be immediately consecrated bishop. By implication, that would seem to require that a papabile (a) be male,(b) be baptized, (c) and be willing ordained a deacon and then a priest, and finally consecrated a bishop if necessary, and (d) have the use of reason in order to accept election and, if necessary, holy orders.

Canon 378 should be regarded in the light of requirements concerning bishops only and not the election of a pope. Bishops are named or appointed to dioceses by Rome after the recommendations of local bishops.


  The ultimate decision in appointing bishops rests with the pope, and he is free to select anyone he chooses. But how does he know whom to select?
  
  The process for selecting candidates for the episcopacy normally begins at the diocesan level and works its way through a series of consultations until it reaches Rome. It is a process bound by strict confidentiality and involves a number of important players – the most influential being the apostolic nuncio, the Congregation for Bishops, and the pope. It can be a time consuming process, often taking eight months or more to complete. While there are distinctions between the first appointment of a priest as a bishop and a bishop's later transfer to another diocese or his promotion to archbishop, the basic outlines of the process remain the same. - How Bishops Are Appointed


Canons 332 and 378 deal with separate subject matters. Since canon 378 deals with the appointment of bishops, Rome has set standards as to what kind of men diocesan bishops should propose to the  episcopacy. Canon 378 deals uniquely with the election of a pope. Nothing more is added to the requirement of a pope so that the Princes of the Church may elect to the office of pope as the Holy Spirit inspires them to do. How can the Church limit the third person of the Trinity, the Paraclete. At the present moment in time the Church sees no need to have further requirements regarding a papal election. Even in Pope St. John Paul II's Universi Dominici Gregis  simply states the same thing: 


  
  After his acceptance, the person elected, if he has already received episcopal ordination, is immediately Bishop of the Church of Rome, true Pope and Head of the College of Bishops. He thus acquires and can exercise full and supreme power over the universal Church.
  
  
  If the person elected is not already a Bishop, he shall immediately be ordained Bishop.
  
  
  If the person elected is not already a Bishop, homage is paid to him and the announcement of his election is made only after he has been solemnly ordained Bishop.
  If the person elected resides outside Vatican City, the norms contained in the Ordo Rituum Conclavis are to be observed.
  
  
  If the newly-elected Supreme Pontiff is not already a Bishop, his episcopal ordination, referred to in Nos. 88 and 89 of the present Constitution, shall be carried out according to the usage of the Church by the Dean of the College of Cardinals or, in his absence, by the Subdean or, should he too be prevented from doing so, by the senior Cardinal Bishop.


Thus a layman may also be elected pope. If a layman were to be elected pope, the newly elected individual would have to ordained a deacon, then ordained a priest and finally consecrated a bishop. Only at this point, would he be truly the next pope, who is the Bishop of Rome.

The Role of the Holy Spirit is of the great importance in the election of a new pontiff to the see of Rome. In the past, 15 to 20 days after a papal vacancy, the cardinals gathered in St. Peter's Basilica for a Mass invoking the guidance of the Holy Spirit in electing a new pope. Before the cardinals entered the conclave to select the next pope, they first celebrate a special Mass. Then they chant the “Veni, Sancte Spiritus” (Come Holy Spirit) as they paraded into the Sistine Chapel.  The master of ceremonies then pronounces the words: “extra omnes” (everyone out).


How Is a New Pope Chosen?
The role of the Holy Spirit at the papal conclave