Expecting students to use a code base that is known to be buggy?
The answer to this question is "Sometimes." 

Given that an instructor has roughly X hours/week to devote to this course (given their other responsibilities), sometimes the best way to utilize that time may be to write a code base for students to use in some fraction of those hours (even though it will be buggy and not up to best practices) and devote the rest of those hours to other things. 

Sometimes improving the code base isn't the best way to utilize instructor time - sometimes that time is better used offering more office hours to answer students' questions, or writing better lecture notes, or something else that is of greater benefit to the students' learning than making the code less buggy. 

It's usually up to the instructor to make that determination of what will best serve the pedagogical goals of the course.

(I'm assuming the professor isn't intentionally trying to give students some experience working with a buggy code base. But that's also a possibility.)

As a student, I didn't think about the time and resources my professors devoted to preparing their course materials. As an instructor, I gained a very different perspective. 

For example, the first course I taught as instructor of record was a course that I was only assigned about a week before class started, in a subject outside my area of expertise, and I had very limited time to prep the first few lectures and assignments. I agreed to teach it despite knowing that my teaching would be underprepared (by my own standards) for the first part of the course, because I thought it would be better for my students than the alternative (the course being cancelled because the department couldn't find any other coverage.) As a student, I would never have thought about my professors being put in situations like that.