I've had similar moments driving at night where I've second-guessed myself about high beams - it's genuinely confusing because they do help you see better, so the instinct to use them makes sense. The thing is, yes, you can actually get fined for using high beams in traffic, and it varies by state and jurisdiction. Most places have laws that specifically prohibit high beams when there's oncoming traffic or when you're following another vehicle within a certain distance. The officer was right to pull you over - this isn't just a courtesy thing, it's a legitimate traffic violation.
Whether you get hit with an actual fine depends on where you were and how strict that particular officer wanted to be. Some jurisdictions treat it as a minor violation with a small fine (maybe $20-50 range, though I'm not sure of exact amounts), while others might just issue a warning, which sounds like might've been what happened to you. If you were just warned, you probably got lucky - consider it a heads up to switch to low beams whenever there's any oncoming traffic or if you're within maybe 300 feet of a car ahead of you. The reasoning behind the law is solid: high beams can seriously impair other drivers' vision and create a safety hazard, even if your intention was just to be more visible.