"These are the offspring of Noach - Noach was a righteous man, perfect in his generations; Noach walked with Hashem" (Bereishis 6:9).
This single posuk contains two clauses: (1) Noach's status within his generation, and (2) Noach's status with regard to Hashem. What is the relationship between these two clauses, warranting their juxtaposition in one pasuk?
We can explain the connection between the two clauses with a Rashi found in Parshas Vayeira. The posuk there records Avimelech's question to Avraham as to why he did not inform him that Sarah was really his wife, not his sister. To this Avraham responded:
"Because I said, there is no fear of Hashem in this place and they will kill be because of my wife" (Bereishis 20:11).
How did Avraham know that there was no fear of Hashem in that place? Addressing this question, Rashi explains as follows: When a guest arrives in town, it is customary and proper that he be asked if he has food and shelter. But when Avraham entered, he was asked only concerning his wife; the people lacked basic derech eretz. Rashi is informing us that if there is no derech eretz between man and his fellow man, it is a clear sign that there is no fear of Hashem. Thus, the natural outgrowth of fear of Hashem is to treat a fellow man with proper derech eretz.
Before we answer our question regarding the connection between the two clauses describing Noach, one more point requires clarification. The posuk says that Noach was righteous "bdorosov." The word "bdorosov" is commonly translated as "in" his generation. It can, however, also be translated as "with" his generation. With this translation, the posuk informs us that Noach was righteous with the fellow people in his generation. In other words, he treated them with derech eretz.
We can now put these two points together to answer our question. The first clause of the posuk informs us that Noach was good to his fellow man. The second clause then explains why Noach was good to his fellow man. He was good to his fellow man because he walked with Hashem, i.e. he had fear of Hashem. Thus, the single posuk teaches that there is a cause and effect relationship between one's behavior towards his fellow man and his status vis a vis Hashem. Specifically, Noach's harmonious interpersonal relationship with the fellow people in his generation was an outgrowth of his fearing Hashem.
Conversely, with regard to the other people of his generation, it is written:
"The earth had become corrupt before Hashem; and the earth had become filled with robbery" (Bereishis 6:12).
In this posuk, the first clause tells us that they lacked fear of Heaven. The posuk then goes on to inform us of the tragic outgrowth of such behavior. Specifically, a lack of fear of Hashem precipitated a lack of derech eretz for one's fellow man, which manifested itself in the corruption, violence and robbery in the generation.