Translation:I stood in front of the restaurant because I wanted to eat something.
Does anyone find it annoying that Duolingo seems to have invented it's own strange rules for English word order? They are marking wrong "....because I wanted something to eat". While it may be a grammatically correct translation from the German " weil ich etwas essen wollte", I think "...because I wanted something to eat." is the way most would express this in English
The two aren't equivalent. The first, "...wanted something to eat," could mean that you want something to eat for now or later. The second, "... wanted to eat something," implies that you are hungry and are looking to get food to consume at the current time. The word order implies the immediacy of the desire and is important.
"I want to eat something" is saying directly that you want to eat the food now. But "I want something to eat" does not necessarily mean that. E.g it could mean you intend to buy food now to eat later.
In this context that is unlikely (because the speaker is taljing about a restaurant) but in general they are not equivalent and I think Duo is correct in rejecting it.
In many places, restaurants post the menu outside the door (sometimes under glass, & sometimes with the prices) , so that potential customers may decide before entering if they can find the dishes that they would like at this establishment, & sometimes whether it's in the price range that they would like to pay.