The common origin of symmetry and structure in genetic sequences