After being instructed by goddess Parvati, Lord Vishnu had gone to Tulsi in the guise of her husband- Shankhachuda, so that the breach of Tulsi chastity could help lord Shiva to kill Shankhachuda, who derived his power from Tulsi’s chastity and virtuosity.
Initially Tulsi could not recognize lord Vishnu. She was extremely joyous at his arrival. But very soon she was able to realize the real identity of lord Vishnu, who had disguised himself as her husband.
She became very angry and cursed lord Vishnu to become a stone. She was crying unconsolably. Lord Vishnu contemplated on Shiva as a result of which he appeared. Lord Shiva blessed Tulsi that she would become the beloved of Lord Vishnu.
Due to Tulsi’s curse, Lord Vishnu attained the form of Shaligram which is a stone and because of lord Shiva’s blessings. Tulsi leaves started being offered to the Shaligram, in the process of its worship.