According to this website, today is the Hamilton Co. Municipal Primary Election, the General Election is scheduled for November 5th, 2019.
On the surface, Indiana is an open primary state, so you do not have to register for a party in order to participate in that party's primary. However, there is a law IC 3-10-1-6 that reads like this:
A voter may vote at a primary election:
(1) if the voter, at the last general election, voted for a majority of the regular nominees of the political party holding the primary election; or
(2) if the voter did not vote at the last general election, but intends to vote at the next general election for a majority of the regular nominees of the political party holding the primary election; as long as the voter was registered as a voter at the last general election or has registered since then.
According to openprimaries.org, this is an attempt to encourage voters to vote along party lines:
- Affiliation with a party is not required to vote in primaries. However, voters can only choose the primary ballot of the party who recieved a majority of their votes in the previous general election, and voter records are kept as public information.
- If a voter did not vote in the last general election, they must "intend to vote for the majority of the nominees on their desired party's ballot."
Voters can be challenged by another eligible voter on suspicion of perjury.
- This system is an attempt to get voters to vote along party lines, but is not easily enforceable.
There is a procedure within the law (a bit further down from the link above, "Challenging voter") that allows other voters to challenge your primary participation, after which you would need to sign an affidavit or make a statement that you intend to follow this law.
All sources (e.g. FairVote) claim this law is hard if not impossible to enforce, but if the poll workers were even passingly aware of it then it is understandably confusing.
To address the part of your question about "why does it matter what party you say you are with," see the question What's the purpose of a closed primary?