"My friends in Denver."
Translation:Мої друзі в Денвері.
We don't like the funny sound of the clashing of two vowels. Мої друзі у Денвері.
Doesn't sound melodic, try to say it a couple of times. "в" there helps to avoid the funny іу sound.
OK, but actually, Duolingo has to accept both. If it doesn't, report! Because "у" and "в" are completely interchangeable, they mean the same thing. Being melodic is not a requirement unless it's poetry or some important speech :) Often we ourselves don't pay attention to this and say whatever first comes to mind.