I think it's because programming and music theory are actually very similar. Both involve manipulating a set of rules creatively to make something that is satisfactory to yourself, while following conventions set by professionals that came way before you. It's really very similar.