As I understand it, your question about the sentence
This is a main difference between the personality of good people and bad people.
involves determining whether "the personality of good people" is being contrasted with "bad people" or with "[the personality of] bad people." Structurally the sentence permits (with a little logical fudging) either reading, though I suspect that the author intends the second one.
That being the case, the biggest weakness of the sentence as written is that it seems to favor a logical reading that finds the intended contrast to be between "the personality of good people" (where "personality" is obviously a singular noun) on the one hand and "bad people" on the other. We can start to overcome that problem by changing personality to personalities:
This is a main difference between the personalities of good people and bad people.
At this point, we still have (from a strictly logical reading of the sentence) a contrast between "the personalities of good people" on the one hand and "bad people" on the other. But beyond that, we have a plausible set of parallels attaching to the stem word of: "good people" and "bad people." And whereas before that of linked problematically to a singular personality, it now links to the plural personalities—a better platform for the parallelism. And we can strengthen the parallelism of these phrases by adding the word of before "bad people":
This is a main difference between the personalities of good people and of bad people.
Now the parallel phrases "of good people" and "of bad people" attach to the stem word personalities—and a reader cannot logically misread the intended contrast as being between "the personalities of good people" on the one hand and "bad people" on the other, without ignoring the of immediately preceding "bad people."
As other answerers and commenters have pointed out, there are alternative ways to make the sentence unambiguously present a contrast between the two types of personalities. For example, you could say
This is a main difference between the personality of good people and the personality of bad people.
But the shorter form that I suggest is every bit as clearly parallel and yet (to my mind) somewhat less tedious.
Conversely, if you wanted to establish a contrast between "bad people" on the one hand and "the personality of good people" on the other, the simplest way to proceed would be to flip their order in your original sentence:
This is a main difference between bad people and the personality of good people.
Either way the things that the sentence is seeking to compare are clearly defined, and readers won't be tempted to misread the writer's meaning.
As a side note, I acknowledge that the form "the personalities of good people and of bad people" may suggest to some readers that the author is comparing multiple personalities of good people to multiple personalities of bad people, whereas the original wording seems to take the view that good people have one unitary personality and people a very different unitary personality. If this change runs afoul of the author's intentions, we could revise the wording (again) to say something like this:
This is a main difference between the personality of good people and that of bad people.
where the new parallels are "the personality of good people" and "that of bad people," both attached to the stem word between.