My university did this - each semester's class inherited the code base the last semester had worked on.
As a learning tool it was a disaster. The code had never been touched by a skilled engineer, just years of undergrads pulling all-nighters.
That meant it didn't teach what good maintenance looked like. Students just piled their hacks on top of someone else's hacks so they could hit the deadline.
It wasn't a good way to learn to write quality software (even if reality sometimes looks this way).
It was also the only software engineering course in our CS curriculum.