Too big to be a spice rack, unless it was in a restaurant.
But why not originally a thread rack for a professional dressmaker? Seems to me I've seen old pictures of ladies visiting their dressmaker, with the background showing something like this. They had very good woodworkers in years gone by, with women who knew darn well what they wanted to make their work easier. Wish I could find out how they stored their materials!
Sure wish I could find something like that in a yard sale or thrift shop. Might have to make it myself.