Sometimes it is the
appropriate, and
safest thing to do. Notice the emphasis.
Some examples;
Pacific Street in Oceanside CA is posted with signs that say "Bicycles May Use Full Lane". The speed limit is also posted 25 MPH. I ride, and drive, this street frequently. I take the lane and do about 18-20 when doing so. When behind a cyclist, often a beach cruiser doing 8-10, and hugging the door zone, I follow until safe to cross the yellow and pass. No problem.
https://www.google.com/maps/@33.1871...IfVhehRorQ!2e0
Multi lane roads with speed limits up to 50 MPH. This is where you really need to pay attention to Appropriate and Safe. Most of the streets like this that I use have bike lanes. I use those unless it becomes absolutely necessary to take the lane, often due to constriction. I look behind, make eye contact, signal very clearly and get out there
IF it looks like any approaching cars are going to let me. Usually they do. They may or may not like it, but that's tough.
Last week I hit a construction zone where the bike lane was an open trench that I could see ran a quarter mile up a 5% grade. I pulled out my smart phone and Google Mapped a detour.
https://www.google.com/maps/@33.6169...GUoxMVhVLg!2e0 (In normal situations this is one of the very few places I ride on the sidewalk. Last week it was torn up completely except for the two left lanes. Hopefully it will be getting a bike lane, but the city with jurisdiction is not one of the most bike friendly.)