Measure depth of finished bed, cut some battens to that size and screw through the pallet wood and into the battens - a couple on 2 facing sides should do the job.
Lazy option is put pallet beds where you want them and bang battens down into soil beneath, making sure the batten stays tight in the corner. No other fixings required - leave the battens a couple of feet above the bed and you can easily drape netting over anything growing inside