Is it ethical for professors to ask graduate students to teach? Universities require a doctorate degree to apply for a faculty position which involves both teaching and research. Even if the professor did not receive any formal training in pedagogy, it is expected that they will pick up a few things over time. 

If a graduate student who does not have a doctorate degree, nor has any formal training teaches a course, wouldn't it be unfair to the students? In many situations, there are no quality/standard checks in place before a graduate student is allowed/asked to teach a course.
Since cultural differences may be important here: I'm in germany.

As you say, the teaching staff in academia learns teaching mostly in a form of training on the job.  Pedagogy training for university teaching staff is a rather recent advance here, and I'm not sure how widespread that is done (read: likely still rare).  

Within that system, you have to start at some point: said professors would lack teaching experience if they had not started accumulating this experience as grad students. 

Here, grad or PhD students start their "teachin career" by first teaching "low impact" courses: settings where bad teaching doesn't do too much harm. 
E.g. a single experiment in a labwork practicum. Or a seminar that discusses homework (i.e. the excercises that all students should already be able to solve on their own). As they accumulate experience (also experience with oral presentations in general), they advance step by step: teaching internal seminars to the group, at some point teaching a single lecture for a colleague. Someone teaching a whole but still small course (typically on subjects related to their research specialization) is typically advanced postdoc/PI level. All these are still under the official supervision of the professor. Finally, teaching university courses without any supervision (i.e. in their own responsibility) is typically achieved after habilitation.  

What about quality checks?
The professor stays responsible for the teaching. So while they can ask a grad student to help with the teaching, they must make sure that this teaching will be at an acceptable quality.