The problem with that theory comes when people who have all of that and more get depressed. I do think you have a point in that the cause can be external but I think to see it as social is far too limited. Then there are cases where it's entirely internal as well, depression being a symptom of various illnesses. I'm not sure if you know this but a lot of theraputic work does focus on solving external problems. You might also observe that there can be quite a catch-22 effect or bootstrapping problem here as well.
To me it seems happiness is basically a big AND-expression of fulfilled needs. If someone is lonely they need community, if someone is scared they need safety, if they are malnourished they need food etc.
Quick note that depression isn't simply "I'm unhappy" (existence of a negative feeling). Depression is characterized by many/all feelings being severely diminished or completely absent. People who think everything's going right in their life still get depressed, and it's something of a trope for some depressed people to wonder how they can be depressed when they can't point to anything in their life that should be depressing.