The Supreme Court has struck down a Texas law forbidding gay sex, voting 6-3.