This, and ‘because that’s how we’ve always done it’ are probably the main reasons party affiliation is part of voter registration.
As to "why" the government should feel obligated to subsidize the process -- because the government has the ostensible goal of facilitating fair and proper elections, and presumably the primary process -- which is not Constitutionally-enshrined -- is a net benefit to the general election, at least compared to selection-by-party-convention. In the future, political parties may decide that it's better to have open primaries, but that's orthogonal to the government providing the voting infrastructure and logistics.
https://www.washingtonpost.com/news/monkey-cage/wp/2015/05/1...
Many include
1) Last time you voted
And
2) what your party affliction is
I worked at a polling company out of college owned by a Standford professor. My first task: After a poll is finished online, match that with voter records (using emails and addresses).
My first question was: "Well, that is a cool idea, but, there is no way the government would release a huge database of every california voter and their party affiliation. Let alone, the users entering in online poll information would extend that database to include their actual vote. There is no way this is possible.... right?"
Standford professor's response: "Do you want it in CSV?"