Actually--the correct phrase is "strait and narrow," although the mistaken version "straight and narrow" is probably much more common now. "Strait" is an old-fashioned and out-of-date word that is a synonym for "narrow" (or "tight" or "confined.") It's out of date and survives only in the geographic name, "straits," meaning a narrow passage between two large bodies of water.
It's a Bible reference, to Matthew 7:13-14, in the "King James Version," the classic 1611 English translation:
"Enter ye in at the strait gate: for wide is the gate, and broad is the way, that leadeth to destruction, and many there be which go in thereat: Because strait is the gate, and narrow is the way, which leadeth unto life, and few there be that find it."
To "keep on the strait and narrow" means "take the right path, the morally correct path."