While travelling on the local Copenhagen train system, I was curious to find plastic bags at the back of each seat.
Why are these kept there / what purpose are they supposed to be used for?
Firstly, that's not a local train - it's the international train that links Denmark and Sweden.
To answer your question: I asked about this when I was travelling on the Øresundståg a couple of years ago as I wanted somewhere to put trash. The train manager told me I can use it for "whatever I want" and that the bags are there as a convenience for customers and to help reduce the amount of trash left openly on the train.
As stated these are international trains and I think the route in Sweden is much longer than the route in Denmark. Öresundtåg is owned by 6 Swedish regions and the Danish DSB.
All intercity and some local trains in Sweden have plastic bags by the seats. They are usually located under the windows (pictured below). Most Danish intercity trains also have a very similar solution (see comments).
They are easy to remove allowing the staff to easily clean the train.
However, Öresundståg has a different solution with bags on the back of the seats. I'm not sure why but it could be that the supplier of these bags is Danish.