There is a story that explains why Shiva is called Ardhnarishwar.
There was a sage whose name was Bhringi. He was one of the extreme devotees of Lord Shiva, which means his reverence was limited to Shiva only. Bhringi never worshipped goddess Parvati, the consort of Lord Shiva.
However, his devotional sentiments were genuine for Shiva, but his fault was he understood Shiva and Parvati as two different beings.
One day, Bhringi decided to visit Kailash Parvat to do the Parikrama of Shiva. He saw Shiva sitting with goddess Parvati. But he was unwilling to do the Parikrama ritual of Shiva with goddess Parvati.
He requested the goddess to leave Shiva for a few moments so that he could perform the Parikrama ritual of Shiva.
The behavior of the sage was nonessential for the goddess Parvati. She replied with a simple no and sat closer to Shiva.
Sage Bhringi was uncompromising, so he decided to take the snake form. He thought it would help him to perform the Parikrama ritual quickly.
Lord Shiva was observing everything happening on Kailash, but he chose to stay calm.
Meanwhile, goddess Parvati merged her half-body with Shiva and presented herself as Ardhnarishwar, which means half Shiva and half Parvati.
After watching that, sage Bhringi became helpless. He still didn’t accept the goddess and Shiva together.
The sage took the form of a rat and started biting them so, as a rat, he could separate Shiva from the goddess.
Adishakti became angry with the sage, and she cursed the sage that whatever body he had gained from his mother would leave him immediately.
Shiva tantra says that people get bones & flesh from their father, whereas blood & other particulars belong to the mother.
After the curse, Sage falls to the ground and realizes his mistake. Sage Bhringi asks for an apology from goddess Parvati. Goddess Parvati is kind-hearted; she forgives the sage.
The curse of the goddess was incurable. Due to that curse, the sage was unable to stand on his legs. So, Ardhanarishvara gave him a third leg, which helped him regain his blood and lost strength.
After that, the sage concluded that you should not consider Shiva and goddess Parvati as two different beings. They are one in two physical forms.