It's discouraged as it puts unnecessary additional load on the forum.
http://stackoverflow.com/questions/94621...http://stackoverflow.com/questions/946214/one-sql-query-or-many
http://expressionengine.com/user_guide/d...http://expressionengine.com/user_guide/development/guidelines/performance.html#redunda
Arguably, this may not be a big issue if you don't have a lot of threads, and have very few visitors to your website (coupled with the fact that many MySQL servers are installed locally on the webserver), however it can be considered bad coding practice (and a hallmark of the n00b script kiddie).
It IS more of a problem if you have a remote SQL server (larger sites, or some shared hosting providers do this) as queries are slower due to increased latency. And if you're a high traffic forum, this can generate significantly more load on the webserver <-> DB server network.
Simple example of an in-loop query:
More appropriate way:
Top one is easier and quicker to write, which is why a lot of people do it, despite it being "bad".