Understanding Allah (swt) and getting closer to Him is the work of the
human being, i.e. the soul, and the soul has no gender. Therefore, a man's
and a woman's capacity in getting close to Allah (swt) is the same.
When the soul comes into this world, it acquires a body, and it uses this
body to perform actions, which is the main tool to get close to Allah
(swt). Actions that are required by us from Allah (swt) are according to
our duties and their value according to our intention. Furthermore, a
certain number of duties are according to gender. In other words, both men
and women have to perform certain common actions with good intention (like
praying) to get close to Allah (swt). They also have to perform certain
actions that are specific to their gender (obeying the husband for the
woman and going to jihad for the man), and these also take them to Allah
(swt), if they have good intention.
Therefore, superiority is according to having taqwa and closeness to Allah
(swt) and this is achieved through actions with good intention, common
actions and gender specific actions.
Imam Ali (s)'s hadiths have various explanations. Some of his hadith
regarding women are talking specifically about a certain person who was
the cause of a war between muslims and the martyrdom of many of them.
Another explanation is that it is not talking about the woman in regards
to her capacity to get closer to Allah (swt), but rather it's pointing at
certain consequences of the way she is created.