9 times out of 10 it's because there's a 'Cell' or 'Solitary' Room tile in the door space. That space needs to be empty apart from the door, as if it's not then the room falls outside of the enclosed area. Just get rid of the tile space beneath the door and you'll be golden!
This was included in an FAQ guide I posted yesterday (sorry about the broken images, I'm getting it fixed!):
https://prisonarchitect.double11.com/headlines/guide-frequently-asked-questions
Hope this fixes it for you!
Nat D11