According to the book, "Public Service Announcements" by Anna Ritter, PSA's were gaining traction in the television industry and started making their TV shows write a script a season that addressed a social issue.
"Pink Pills And Purple Parents" was Carl Reiner's answer to satisfy this requirement.
At first he resisted because he felt there was no way to keep the show funny with such a heavy handed message.
He had Gary Marshall of Happy Days fame to write the story. Marshall found a way to express taking pills from a friend was not something one should do.