Firstly, female authors do not hold a monopoly over female themes and seminal feminist works. You only have to look at Gustav Flaubert and George Bernard Shaw's works to see that male authors can explore feminine themes with as much intricacy and sensitivity as female authors. Therefore, Shakespeare's dealing with the limits of the female sex and challenging the role of women in society is not in itself evidence of the author's gender.
Secondly, Shakespeare is able to develop such strong female relationships because he has a masterful understanding of the human condition. He was able to construct deep and meaningful relationships among many of his characters, not only his female characters. The relationship between Lear and his fool, Hamlet and Horatio, and Caesar and Brutus are also masterfully crafted. His ability to build convincing and intricate female to female relationships is not an indication of Shakespeare's gender but of his genius.