No, this is very far from legal. There are a few--very few--times when a company may legally hire someone only of one gender or the other. For example, a sports club or hotel, which is hiring for a locker room or bathroom attendent, could clearly only hire woman for the ladies room, men for for men's room. A male doctor may be able to only advertise for an hire a female nurse, if he needs a woman in his office to be present when examining a female patient. Jails and prisons can hire some guards specifically of  each sex, to work in the appropriate wings of the prison. Etc.But  barring situations like that, sex discrimination in employment is illegal, and a business may not hire only women to attract male clients.