That is because a plot best represents a part of a reality and by imitating parts of reality we can learn from them. In tragedies, you observe people better than you and you learn of virtues, while in comedies you observe people worse than you and you learn of bad behavior.