I read it as the students being familiar with a similar "trick" question and erroneously pattern matching on that.
Another similar riddle goes like:
"If it takes 5 machines 5 minutes to make 5 widgets, how long would it take 100 machines to make 100 widgets?"
The correct answer there being "5 minutes", and the intuitive wrong answer being "100" as per your post.
That would make sense as to why the teacher also expected "3", since they should be familiar with the existence of their non-intuitive questions, even if they misremember the specific non-intuition.
Another similar riddle goes like:
"If it takes 5 machines 5 minutes to make 5 widgets, how long would it take 100 machines to make 100 widgets?"
The correct answer there being "5 minutes", and the intuitive wrong answer being "100" as per your post.
That would make sense as to why the teacher also expected "3", since they should be familiar with the existence of their non-intuitive questions, even if they misremember the specific non-intuition.