Castlewood was platted in 1881 when the railroad was extended to that point. The city was named Castlewood after a place mentioned in the 1857 novel The Virginians by William Makepeace Thackeray. A post office has been in operation in Castlewood since 1882.
At the 2010 census there were 627 people in 260 households, including 158 families, in the city. The population density was. There were 292 housing units at an average density of. The racial makeup of the city was 96.5% White, 0.5% African American, 0.5% Native American, 0.2% Asian, 1.4% from other races, and 1.0% from two or more races. Hispanic or Latino of any race were 1.8%. Of the 260 households 35.4% had children under the age of 18 living with them, 50.4% were married couplesliving together, 6.9% had a female householder with no husband present, 3.5% had a male householder with no wife present, and 39.2% were non-families. 33.5% of households were one person and 17.6% were one person aged 65 or older. The average household size was 2.41 and the average family size was 3.16. The median age was 36.2 years. 28.2% of residents were under the age of 18; 7.4% were between the ages of 18 and 24; 26% were from 25 to 44; 24% were from 45 to 64; and 14.5% were 65 or older. The gender makeup of the city was 50.2% male and 49.8% female.
At the 2000 census there were 666 people in 253 households, including 185 families, in the city. The population density was 585.9 people per square mile. There were 265 housing units at an average density of 233.1 per square mile. The racial makeup of the city was 98.95% White, 0.45% Native American, and 0.60% from two or more races. Hispanic or Latino of any race were 0.30%. 38.1% were of German, 18.4% Norwegian, 9.9% Dutch, 6.8% American, 6.4% Irish and 5.6% English ancestry according to Census 2000. Of the 253 households 40.3% had children under the age of 18 living with them, 60.5% were married couples living together, 7.9% had a female householder with no husband present, and 26.5% were non-families. 24.1% of households were one person and 14.2% were one person aged 65 or older. The average household size was 2.57 and the average family size was 3.06. The age distribution was 28.5% under the age of 18, 8.1% from 18 to 24, 26.6% from 25 to 44, 20.6% from 45 to 64, and 16.2% 65 or older. The median age was 35 years. For every 100 females, there were 94.7 males. For every 100 females age 18 and over, there were 91.9 males. The median income was $36,607 and the median income for a family was $41,806. Males had a median income of $29,688 versus $20,750 for females. The per capita income for the city was $17,682. About 7.7% of families and 7.1% of the population were below the poverty line, including 12.0% of those under age 18 and 6.7% of those age 65 or over.