Why are cockpit voice recorders limited to 2 hours recording?
Aviation manufacturers generally design the equipment to comply with legal requirements. Under FAA two hours is what is required by law.

14 CFR  121.359–Operating Requirements:  Domestic,  Flag,  and Supplemental  Operations–Cockpit  Voice  Recorders
(i)  By  April  7,  2012, all  turbine  engine-powered  airplanes  subject to  this  section  that are manufactured  before  April  7, 2010, must  have  a  cockpit  voice  recorder  installed that  also—
(1)  Meets  the  requirements  of  §23.1457(d)(6)  or  §25.1457(d)(6)  of  this  chapter, as  applicable;
(2)  Retains  at  least  the  last  2 hours  of  recorded  information using  a  recorder  that  meets  the standards  of  TSO-C123a,  or  later  revision;  and
(3)  Is  operated  continuously  from  the  use  of  the  checklist  before  the  flight  to completion of  the final checklist at the  end  of  the  flight.
(4)  If  transport  category,  meets  the  requirements  in §25.1457(a)(3),  (a)(4),  and  (a)(5) of this chapter.
[The following section has the same requirements for aircraft manufactured after April 7, 2010.]

The flight data recorder is required to retain 15 hours worth of data.
FAA allows pilots to erase anything on the CVR recorded 30 min (in some cases 15 min) prior. This is probably something that was negotiated between the NTSB and the pilots union to protect the pilots' privacy.  Since it's written into the statute that way I assume modern digital CVR'S must have a function to erase everything but the last 30 min. (@OSUZorba there's that word again)

14 CFR  121.359 (f)  In  complying  with this  section, an approved  cockpit  voice  recorder  having  an  erasure feature  may  be  used, so that  at  any  time  during  the  operation of  the  recorder, information recorded more than  30  minutes  earlier  may  be erased  or  otherwise obliterated.

This was most likely in response to the 1979 incident that occurred on TWA flight 841 where the pilot was accused of improperly extending flaps during cruise but had erased the CVR when they landed,  so they had no proof. At the time CVR's were still fairly new and pilots balked at having their conversations recorded for privacy reasons, so it was common practice to erase it after each flight. There is still some concern over privacy issues since in some situations the recording can open the pilot up to legal liability.
There are really only a handful of cases where a longer recording would have been useful, most of which involved pilot incapacitation. In 2014 EASA proposed extending the requirement. The European Cockpit Association, which represents pilots released a position paper .pdf stating that they would only support the extension if there were also systems in place to ensure that only the pertinent portions could be used and any other conversation could not be leaked to the public or used in jurisdictions where there are no legal requirements to maintain pilots' privacy.

ECA  stresses  the  following:

Pilots  submit  to such  recording  under  the  strict  condition  that  the  CVR  data is  to be  used exclusively by  accident  investigation authorities in  the  context  of  their  safety  investigations.  Pilots  are  one of  the few  professions  that  agree  to  being  recorded  at  their  workplace  and  the  consequent  infringement  of their  privacy

National  and  European  legislators  recognise  the  need  to  protect  CVR  recordings  (Reg.  996/2010). However,  despite  various  legal  provisions  at  EU  and  national  level,  as  well  as  best  practices  in many  airlines,  CVR  data  or  their  transcripts  have  too  often  leaked  to  the  public  and  media , exposing  data  with  private  and  personal  content  –  sometimes  the  last  minutes  of  the  crews’  lives  – to  a  wide  audience,  generating  speculation,  interpretations  and  apportioning  blame  –  in  a  way  that may  be  far  removed  from  what  actually  happened,  what  contributed  to  the accident  and why.

This  inappropriate  use  and  distribution  of  sensitive  CVR  data  beyond  accident  investigation agencies  negatively  affects  Just  Culture  and  the  safety  improvement  efforts  in  Europe.  Extending CVR duration would increase the  quantity  of  data  available for  misuse  significantly.

Leaking  of  CVR  data  results  in speculation that  increases  the  pressure on  accident  investigators,  on the  judiciary  to  act  quickly  to  hold  accountable those  ‘responsible’,  and  on  other  authorities  or  public figures  to  come  up  with  quick  answers,  rather  than  waiting  for  the  Final  Report  to  be  published  and generating  mature  safety  improvements.

Increasing  CVR  duration  would  also  increase  the  data  that  is  potentially  available  to  the  airline management.  While   many  companies  in  Europe  have  internal  procedures  –  and  sometimes agreements  with  the  pilot  representatives  –  in  place  to  ensure  sensitive  data  is  not  misused,  this  is not  the  case  for  all  companies.  Hence,  an  increased  recording  time  –  combined  with  very  powerful digital  storing  facilities  and  the  possibility  to  cross-check  CVR  and  FDM  data  –  would  also  increase the  scope  for  (un)intentional  (ab)use  of  such  data  by  company  management  for  other  than  safety purposes  (e.g.  any  form  of  disciplinary  measures).  Although  this  would  not  be  in  line  with  EU legislation,  not  all  airlines  are  as exemplary  as  some,  and not  all  legislation is adequately  enforced.

Increasing  CVR  duration  on  European aircraft  also increases  the  risk  of  CVR  data being  used  –  and potentially  made  public  –  by  non-European  authorities,  which  are  not  bound  by  EU  legislation  and the  protections  contained  therein.  This  is  the  case  especially  for  long-haul  operations  (at  which  an increase  of  the  recording  time  is  actually  aimed)  where  the  majority  of  the  flight  is  outside  Europe.  If an  accident  happens  outside  Europe,  the  national  safety  and  judicial  authorities  will  be  entitled  to seize  the  CVR  and  will  be  bound  by  their  own  local  laws,  by  local  political  considerations,  and general  public  pressure.  –  This  would be  an  unintended  –  but  very  real  –  consequence  that  must  be taken  into  account.