Authorship of code published in Zenodo for non-contributing authors of main paper
It is an interesting situation. Clearly the 'authors of the code' have the copyright (and the repository shows who actually contributed). But the purpose of the code was to address a question broadly, as demonstrated by the broader group on the paper. For the purposes of a DOI (which does not indicate IP ownership on the code) I think having the same author list as the paper is acceptable, but not necessary.
As something else to think about, would the code have been developed outside the context of the project leading to the paper? Did the non-code-writing collaborators have no intellectual input to the code?
As an aside, if the repository URL disappears, then  the DOI link will die as well.