Technically yes. The only issue I can see is that many Masons tend to be a bit on the conservative side and alternative lifestyles are not widely accepted.
There was a case recently where a man (who was married when he joined Freemasonry) divorced his wife and then came out as gay publicly. He was expelled from the Fraternity. The charge was unmasonic conduct. In the end did it really matter? The truth is his Lodge brothers now felt uncomfortable with him, many due to their religious beliefs some because they felt like they were duped and that he lied about who he was to gain entrance. Either way he caused disharmony in the Lodge and that is a big no-no.
At this point in time an openly homosexual man would have a tough time joining Freemasonry in most parts of the country. In more urban or Cosmopolitan areas it may be easier.
My personal view is " I could care less" straight or gay. However one of the central things in Freemasonry is harmony. If some of the members did have an issue with a gay man joining to not cause disharmony I would reject the petitioner. If they were OK with it, I would not have a problem.
Bottom line: If a man is liked and the lodge knows his status and wants him as a member it will happen, if not, they will reject him. It is really up to the individual Lodge.
NOTES:
It may be true that some men in the past or even in the present who have joined Freemasonry are/were gay. Of course they adopted a 'don't ask don't tell' type policy or are down low or whatever, so there really is no way to tell. One case in point is J. Edgar Hoover. Most believe he was ..well not straight, but he was a Freemason. Of course the details of his eccentricities didn't come out until after he was dead.
Someone who is rejected from joining Freemasonry cannot sue. It is not a government or public organization. It is a private organization and it does not take or need and public funds, so it can have whomever they like join and reject whomever they please and for any reason. In fact they don't have to even give a reason, they can just say no. Membership is based on a secret ballot and it is in the by-laws that no Mason can be compelled to give his reason for voting no or yes.
There is no US law that says a private group must accept whoever asks. The law suit thing has been tried before and all have been dismissed even before coming to trial.