Does a lecturer have the right to prevent students from making their notes public?
You don't say where in the world all this is taking place.  As usual, both the country and (in some cases) the specific university matter, as the laws vary and (probably more significantly) the academic culture varies.


  A lecturer does not make slides or lecture notes available (e.g. on the course website) in an effort to force students to show up at lectures. 


An instructor does not have to make slides or lecture notes available full stop.  Academic culture seems to be changing in the direction of lecturers giving slide presentations, and since you are showing your slides exactly as they are, not making them available to students seems a bit more conspicuous than not giving out your lecture notes.  But many instructors still do not use any special materials and feel that it is up to the student to get the content from the lectures.  

It is a common sentiment among instructors to do business in a way that does not make it too easy or appealing for a student to skip class.  


  Some of us students feel this is a terrible policy: many students learn the material just fine without attending each and every lecture, so it is not a necessary policy, and it also seems unethical to force us all to show up, because what if we just happened to have something more important to deal with on some given day?


Unethical is very strong.  Again, your location probably strongly informs the academic culture, but e.g. I don't know of any American university where the instructor who claims that students should, in general, come to class would not be supported by the administration.  At my big state university, there is a blanket attendance policy, to the extent that there is a statement from the administration that students are expected to attend class.  This gives support for individual instructors to create their own specific attendance policies.  In my undergraduate classes I have often had mandatory attendance policies, to the point of factoring attendance into course grades and also to the point of (rarely, but it has happened) withdrawing students from my course for very poor attendance.  On the other hand, I was a postdoc in Montreal, and at Concordia University in particular it was expected that instructors would give students the option of a "100% final": that is, the entire course grade would be the final exam.  When I taught a course there, two students exercised this option: one got an A, the other an F.  If you don't know, ask the question "Can the instructor require attendance?" to an administrator or academic advisor.  You should get a clear answer.  If it's yes, then you have no leg to stand on about this policy.  (Yes, that does not stop it from being unethical, but if you really feel that way: don't attend that academic institution.)


  As a response, some of us have decided to write extensive notes together and put them up on a filesharing website, and we've notified other students of this using the course websites' discussion forum. The lecturer has now messaged one of us (the one who made the post on the forum) and told him to stop doing this.


If the instructor wants or requires you to come to class, then look at from his perspective: he is not going to be pleased if he sees students brazenly making arrangements to avoid coming to class.  You are rubbing your lack of respect for his wishes in his face.  This is a bad idea.  


  What should our response be? Does the lecturer have any say in this? Are we in the wrong? 


Well, first I want to say that you haven't actually given a good reason for not wanting to come to class.  You say "what if we just happened to have something more important to deal with on some given day" but...do you?  If most students attend, say, 90% of the lectures, I'm not sure why you need a filesharing program: you can just copy your friend's notes for the few lectures that you missed.  On the contrary, a filesharing program looks like a systematic plan for the students to avoid the lectures: again, you may have the right to do so, and you may have good reasons for doing so, but...do you actually or are you just being difficult about it?  I have taught at the university level for almost 20 years, and in my experience: there is a high correlation between coming to class and student success.  Even if you win a battle not to attend class, the victory seems rather pyrrhic to me.  

However, if you feel strongly that it is in your best interest not to attend most or all of the lectures and your right to do so is supported on the institutional level, then: check to see whether there is any institutional policy against students sharing lecture notes.  I would highly expect there not to be such a policy.  Assuming that's the case: yes, you can share lecture notes.  I advise that you contrive to do it more quietly.  Giving your instructor even plausible deniability that you are not sharing your lecture notes should go a long way towards defusing the situation.