Some dogs are trained to use a crate like a "den" so they can be easily kept out of trouble when the family isn't home. My maltese is crate trained, and it actually serves as a "safe space" for the dog, especially with smaller dogs. You have to do it right - leaving the door open (the doggo is free to go where they want), never punishing the dog inside or with the crate, etc. My dog actually loves it, especially at night, and he has a separate bed outside the crate if he wants to sleep there. But he usually prefers a crate with a towel partly over the top as a sort of den.
Null@pawb.social already gave a great answer. Suki has a crate connected to a park. They're both always opened and the plan was to create a safe space for her. However the crate became her goto spot for peeing so we place doggy pads in there until she learns not to pee inside anymore. The park will be dismantled soon as it has no real purpose anymore. In the picture, she's resting on the park opening, the crate is on the left. Unsure at this point whether we'll keep the cage/crate once she's clean, we'll see if she wants to keep it but I heavily doubt it.