code in Texas is no more than 4 inches apart. I build decks for a living and install many railings. I saw a code enforcement official test my spindles. He used a four inch in diameter rubber ball and if the ball passed through the spindle, it did not pass.
This is the same test used for baby beds. The four inches is the size of a baby's head when young.