A Baltimore judge ruled yesterday that Maryland's law banning same-sex marriage is discriminatory and "cannot withstand constitutional challenge," throwing open the possibility of a bruising legislative battle over a constitutional amendment.