Högsta domstolen i USA har beslutat att städer kan ha förbud mot att hemlösa människor sover utomhus.