(I am not a native speaker)
Because the object is here not only a single noun, but a noun with an indicative, which is here "Welche" (which). Just like
"Rote Äpfel ißt du?"
Here the object is "Rote Äpfel", and not only "Äpfel".
As a rule of thumb: if you need to change the ending of the word to match the gender of the noun behind it, then it is an indicative.
So, the object-verb-subject ordering is correct in the first sentence.
In the sentence "Welchen magst du Sport", the indicative and the noun are separated, making the sentence practically incomprehensible for anybody, both for native and not native speakers. It looks like randomly collected words in a mailspam.
P.s. I think, here "Sport" should be in plural. Furthermore "Sport" is a collective, uncountable noun in German. So "Welche Sportarten1 magst du?" would sound better to me.
P.s.2. In German, all the nouns are written with capital letter. If you don't do it so, your sentence remains comprehensible, but it will look very badly.
1Tyvm @Janka for the native-level fixup. :-)