Question: Is it legal for a professor to ask me for a doctor's note or a copy of a medication being prescribed for a health issue that caused me to miss one class?
This is a good question but a tough one to answer. Most universities allow professors to set their own class-attendance policies. However, if your reason for missing a class is connected to a medical condition or disability, the professor cannot require a specific explanation of your absence (i.e., he or she cannot request the details of your health condition but can expect verification that your absence should be excused for health reasons). So, as you can see, there's some gray area here between what the prof can demand and what you should feel obligated to provide.
At many universities, a one-time absence falls under the rubric of the Honor System ... that is, the professor will not expect proof of the illness unless it persists through three or more classes. However, professors typically do have some leeway when it comes to setting their own policies on absentees.
Since you may encounter this situation again during your college career, I suggest that you check your student handbook to see if there are rules in place that govern the reporting of an absence to a faculty member. If the handbook is confusing ... or if it's too much of a treasure hunt to find the information you need ... ask an academic dean. If the dean isn't helpful or the response doesn't satisfy you, try the disabilities coordinator at your school (even if you don't have a disability). Most colleges have someone in this role, although their titles may vary. Ask about college policy regarding reporting absences due to medical conditions.
Since few students make it through four years of college without skipping some classes for illness, and since it sounds like at least one faculty member at your school is a stickler for attendance, you would be wise to find out about the guidelines at your school. If you anticipate ongoing absences due to your health issue-- even just sporadic ones--you might want to ask your physician for a generic note that simply says that you are being treated and may occasionally be unable to attend class. This doesn't give up very much and may keep the pickiest profs off your back.