I realize that no one can go into Luo Guanzhong's mind and figure out what he was thinking, but if a pro-Shu / anti-Wei perspective would have been common in that period (much as, say, the pro-Spartan/anti-Persian perspective in Frank Miller's 300 is not wholly due to Miller's idiosyncratic view, but to some degree reflects our culture's view), I'd be curious to know about the milieu that lead to that view.
From my American perspective, I can't see why Chinese of a millennium later would be more invested in any one of the Three Kingdoms period states over the other, but then I'm sure many people not versed in 20th/21st century American culture wouldn't understand why anyone today would care about Spartans or Persians from over two millennia ago.
Was it mostly that the Shu were sort of scrappy underdogs, or that they took Liu claims of Imperial legitimacy seriously, or what?
The reason Shu was favored was that at the time, the Ming Dynasty was undergoing a period of Han dynasty romanticization. Much like "Gone with the Wind" romanticized the antebellum South, the history of the Han dynasty was romanticized during the Ming Dynasty as well. As a result, the Shu faction, claiming legitimacy from being directly descended from the Han dynasty (as Liu Bei was a member of the Liu imperial family), was seen as being "Han" and thus was portrayed in such a positive way.
Romance of the Three Kingdoms is a re-imagining of Chen Shou's Records of the Three Kingdoms. Chen Shou was trained by Shu kingdom officials (in the late days of the war) and became one of Shu's librarians. When the Jin Dynasty began, he was charged with the task of writing what had transpired. One could say that history was written by the losers, in this case. Luo Guanzhong took his information and embellished (to say in the least), so the clear polarity in Romance became pronounced.
Follow up question: how much evidence is there for the depiction of Liu Bei as a noble and just ruler?