As many of you have no doubt experienced, settlement happiness tends to stall out at odd levels, for seemingly no reason, despite having enough food/water/beds/defenses.
I found have the cause for at least some of this.
Go to an affected settlement, and look at your beds with the workshop open. You will see many of them are unassigned, despite having enough settlers to fill them.
MANUALLY assign your settlers one of the unassigned beds until all of them are filled.
This has brought my settlement happiness levels up anywhere from 6-10 points since the game sees the beds, and thus doesn't give you the alert of "not enough beds", but is treating it as if they don't have beds since they are counted as unassigned.