Those in middle school should still get bedtimes especially if they can't be trusted/responsible enough to go to bed at a decent time.
My brother when in middle school had to have a strict time of 7:30-8:00pm for bedtime- if this wasn't in place he was up the whole night. While my other brother was able to stay up until 10:00pm while in middle school. I have another brother who is currently staying up until 8:30pm-9:00pm. I also have a sister who has Autism and she was required to have a bedtime of 7:00pm while in middle school.
So in most cases I believe a bedtime still should be set but if the middle schooler is able to go to bed themselves at a decent time and get enough hours of sleep and be able to function the next morning/don't have to sleep in for several extra hours then it is fine for them to be able to have a bedtime they chose within reasonable time limits.
They need their own assigned bedtimes because they need to get their sleep. In school, They learn a lot. Without sleep, They can't remember what they learned during the day in school, Which can cause learning and focus problems when they are older. They will fail classes and fall down in grades without sleep.
Middle school children are coming of age. This is a time in their lives where they are beginning to learn how to take care of themselves, And are beginning to go into the stage of learning how to be an adult. Allowing them to pick their own sleeping times is a start at this. If they stay up late, They will feel it the next day when they're tired all throughout the next day. They will either change and adapt, Or continue to feel this consequence time and time again. In addition, Strict bed times don't work with most students nowadays because of busy schedules and rigorous amounts of homework. In order for students to learn how to live on their own, They will have to start small. One way is by allowing middle school children to select a bedtime that works for them as an individual and having them independently stick to that routine.