A Japanese court ruled Monday that the country’s ban on same-sex marriage does not violate the constitution, and rejected demands for compensation by three couples who said their right to free union and equality has been violated.