Answer from @JerryJeremiahJerry Jeremiah's comment
Your CSV file was made on Windows and has Windows line endings. But yhe computer you are running this on uses UNIX style line endings so each line in the CSV has a \r at the end that is not being removed. There are multiple ways of removing the \r from the CSV file - or you could even do it inside this program after reading the data.
Took it into notepad++, edited the newlines to be just LF, and that fixed it.
Thanks!