Because they were professions that dealt primarily with women and upper class women at that. The upper classes traditionally tolerated homosexuality with a wink and a nod in a way the lower classes did not. These professions also allowed a way for women to interact with men who would not generate scandalous gossip if these women were seen alone with them.
All this developed in a time when household staff was not an uncommon thing. Even middle class families had at least one housekeeper while upper class families had staff ranging from the single digits to veritable armies. At the same time, women could only be in the presence of non-male relatives when a chaperon was present. That could range from a lady's maid to another close relative. Engaging with strange men, even if vendors or married male friends, was seen as inappropriate.
When gay men entered these professions, women were suddenly allowed to visit a man's shop on their own, engage their services, and invite them into their home without a chaperon. They were the few men whom a woman could enjoy the company of without raising eyebrows. That was as valuable to the gay men as to the women and it's one of the reasons that gay men like these became not just socially acceptable among the upper classes, but socialites in their own right. One would only order flowers from the fashionable young man, one would only hire the interior decorators who did other upper class houses, one would only go to the man who called upon Mrs. Astor to do her hair. That's how rigid Gilded Age society was (that's the time gay men began to be out in the most limited manner possible). Other professions included milliners, footmen and butlers, and secretaries. It wasn't until the advent of typewriters that secretarial services became a women's profession. Many of these jobs paid so little that no man could support a family so only men who were potentially out of the breeding stock could afford to take the jobs.
Men have only recently entered nursing and flight attendant fields due to the reversal of discrimination. Both were exclusively female areas since the beginning because, for flight attendants, airlines wanted to hire only attractive young women to attract male business fliers, and, for nurses, the character of woman was seen to be naturally capable of care and compassion beyond what a man was capable of. Nurses could be comforting in a motherly way which was seen to be helpful. The same with teaching of elementary level children.
That's not to say women had it easy by any means. Though these women had independent income they were paid little and they were expected to live a morally decorous life. Any hint of inappropriate behavior could get them fired. Nurses usually lived in dormitories, had to be home by a certain hour, had to dress conservatively, and could never entertain men in their quarters. The desk matron/rottweiler kept a watchful eye on everyone.
Of course gay men could enter any area of work he desired so long as stayed closeted and had a family.