A federal appeals court has ruled that an Indiana law banning registered sex offenders from accessing Facebook and other social networking sites is unconstitutional.