suggests that
cheerfulness tends to attract companionship, while sorrow can leave a person feeling isolated; it does not mean that others never offer comfort.
also
Laugh and the world laughs with you; weep and you weep alone : When you are happy you have a lot of people near you but when a disaster happens you stay alone
Imagine a case where when someone is happy, everything seems right.; then “Laugh and the world laughs with you” fits well.