While playing with other children helps your child to develop incredibly important social/emotional skills like turn-taking and communicating with their peers, it's also perfectly fine for children to play on their own as it helps them to develop other social/emotional skills that they might not develop as strongly in a group setting.
As an ECE, where it is my job to keep an eye on the children that I work with at all times (even when they think they are alone), one of the biggest things that I learned while on maternity leave with my son was that I didn't have to be near him every single second of the day. It was okay for me to sit an read and let him explore.
As he got older, I started to realise that I also didn't need to have every single part of his day scheduled with activities, and that it was perfectly fine for me to let him be on his own with his toys in his room, or for me to be doing my own activity while he was doing something else nearby.
Not only can it be exhausting to put the expectation on yourself to fill every moment of your child's day so that they are never bored, but it also erases the moments of boredom that make it possible for your child to come up with ideas and activities themselves to get rid of that boredom themselves.
Playing alone helps your child to develop independent problem solving skills that they might not have had the opportunity to get if there is someone else beside constantly solving their problems for them (peer or adult). It also creates a situation where they have to make their own fun, to push their boundaries of creativity, and to figure out how to calm themselves when they are frustrated (self-soothing). A certain sense of pride and accomplishment follows inventing your own task or game and completing it, too!
There's also nothing wrong with your child having some quiet time for themselves, especially if they've just completed an activity or task that required a lot of energy, or was a sensory over-load. Time to yourself is an excellent way to recharge your battery (and it gives parents time to recharge too!).