Definitely a question for your advisor, because these kinds of things vary by school.
At my school, all students have to meet certain general education requirements, regardless of major. An astronomy course could be taken to meet the science requirement. However, most nursing majors take one of their required biology courses for that, because it can count toward both their gen ed and their major.
Taking an extra course is not usually a big deal, although it could delay your progress toward graduation depending on your current progress and the nature of your program.