This is important, because it is not the priest of his personal worthiness who accomplishes the miracle: otherwise, none of the faithful would *ever* know if they were receiving the true consecrated Body-Blood-Soul-Divinity or not, due to the fact that nobody could know whether a priest might be harboring some secret mortal sin.
This is moral realism. Yes, even Judas could have consecrated validly.
>>>I don’t think it requires godly purposes. A priest in mortal sin can consecrate, even, if he (however obscurely) intends to “do what the Church does.”<<<
That gets into a bit of psychology. “Whether the objective is to consecrate as the Church intends,” in this case moral character of the priest is immaterial, doesn’t enter into the question of whether there is a correct intention.
I think there is certainly a matter of it being one of intent to consecrate. This is a question that the Church might have answered already.