It's a versatile phrase that has been used to name, for example, both a faith-based rehab clinic and a book about religious views on homosexuality.
Here's what the Apostle Matthew wrote, quoting Jesus: strait is the gate, and narrow is the way, which leadeth unto life. (Matthew 7:14)
In other words, few take the challenging path to heaven most choose a route filled with false prophets, which looks easier but ends in destruction.
Straight and narrow came to describe the rules of propriety and rectitude.
Some might say Matthew himself traveled both roads. Before he decided to follow Jesus, he was one of Herod's despised tax collectors.