Applying to a masters program based on university rankings? I'd very much love to study Math at the University of Copenhagen.

Since I am an International Student and cannot really see the university before I apply, university rankings will greatly affect my decision.

My only problem is that this university ranks quite low according to Times Higher Education (160th)

I relied on rankings to choose to come to Canada and do my undergrad at UBC (32nd) And it has worked well for me so far.

If I happen to be clever enough to get into a top 50 university, would it be stupid to still go to Denmark?
Is it stupid to go to a university which is ranked around 160 by Times Higher Education for a Master's degree?  You should consider additional information.  First, I recommend deciding what you want to do after getting your master's degree.  Then consider if the degree program you are applying for will help you achieve that goal.  If you are not sure, check the program or school website for statistics, or contact the program's alumni for advice.

Since this is the academia stack exchange, let's assume for the moment you want to continue in academia.  In this case, the university's reputation (which is correlated with its ranking) is very important, but the specific program's reputation is even more important.  (edit: People who know little about you will judge you based on the institution/program where you got your degree, because it is easy for them.)  Working with a well-known faculty member can also have great importance.

Certainly rankings will not inform you if you will like living or working at an institution.  Finally, normally each time you change institutions the prestige of your new position will decrease.