The first is that the Death Star trash compactor had been used so rarely or that the station had been serviced so little that an ecosystem had begun to develop inside the trash compactor and who knows where else in the Death Star and a large tentacle beast had grown in this would be womb deep inside the most destructive weapon in the galaxy
The second is they just threw a tentacle monster in the trash