Affirmed by published opinion. Judge WILLIAMS wrote the opinion, in which Judge WIDENER and Senior Judge STAPLETONjoined.
OPINION
Daniel L. Veney, an inmate incarcerated at Riverside Regional Jail in Hopewell, Virginia, filed the present action under 42 U.S.C.A. § 1983 (West 1994), alleging that defendants Lieutenant T.V. Wyche and Superintendent Darnley R. Hodge violated his rights under the Equal Protection Clause of the United States Constitution by treating him differently from other inmates because of his gender and sexual preference. Specifically, Veney claims that defendants denied his requests to move from his single-occupancy cell into a double-occupancy cell because he is a homosexual male. The district court, after screening Veney’s complaint pursuant to 28 U.S.C.A. § 1915A (West Supp.2001), dismissed the complaint for failure to state a claim upon which relief may be granted. Because we agree with the district court that even if all of Veney’s allegations were true, he would not be entitled to relief, we affirm.
I.
Veney has been incarcerated at Riverside since January 23, 2000. With the exception of two days, he has been held in a single-occupancy cell. On December 17, 2000, after several requests to switch into a double-occupancy cell were denied, Ve-ney filed a grievance with Riverside alleging that prison officials, by not allowing him to switch cells with other inmates, were discriminating against him because he is a homosexual male. On December 22, 2000, Captain L. White ruled that Ve-ney was not being discriminated against. Veney unsuccessfully appealed White’s decision under the Riverside grievance procedure. On March 7, 2001, Veney filed a pro se complaint in the United States District Court for the Eastern District of Virginia under 42 U.S.C.A. § 1983, alleging that prison officials had violated his constitutional right to equal protection of the law.
In his complaint, Veney claims that he is being treated differently from similarly situated heterosexual males and homosexual females, both of whom, asserts Veney, are housed in double-occupancy cells at River*730side. The district court, as required under the Prison Litigation Reform Act of 1996 (PLRA), reviewed Veney’s complaint to identify any cognizable claims. See 28 U.S.C.A. § 1915A (West Supp.2001). After careful consideration of Veney’s pleadings, the district court determined that his complaint failed to state a claim upon which relief may be granted and dismissed the action. On appeal, Veney challenges the district court’s dismissal of his equal protection claim, asserting that his complaint alleges specific facts showing that correctional officials treated him differently from similarly situated inmates without a legitimate penological reason for doing so.
II.
Under § 1915A, the provision at issue in this case, the district court is required to review any “complaint in a civil action in which a prisoner seeks redress from a governmental entity or officer or employee of a governmental entity ... [and] identify cognizable claims or dismiss the complaint, or any portion of the complaint, if the complaint ... fails to state a claim upon which relief may be granted....” 28 U.S.C.A. § 1915A(a), (b)(1). We review dismissals for failure to state a claim de novo. See Sanders v. Sheahan, 198 F.3d 626, 626 (7th Cir.1999) (concluding that dismissals under § 1951A for failure to state a claim require the same standard of review as dismissals under Rule 12(b)(6)); Davis v. District of Columbia, 158 F.3d 1342, 1348 (D.C.Cir.1998) (same).
A complaint should not be dismissed for failure to state a claim upon which relief may be granted unless “after accepting all well-pleaded allegations in the plaintiffs complaint as true and drawing all reasonable factual inferences from those facts in the plaintiff’s favor, it appears certain that the plaintiff cannot prove any set of facts in support of his claim entitling him to relief.” Edwards v. City of Goldsboro, 178 F.3d 231, 244 (4th Cir.1999). Moreover, when such a dismissal involves a civil rights complaint, “we must be especially solicitous of the wrongs alleged” and “must not dismiss the complaint unless it appears to a certainty that the plaintiff would not be entitled to relief under any legal theory which might plausibly be suggested by the facts alleged.” Harrison v. United States Postal Serv., 840 F.2d 1149, 1152 (4th Cir.1988) (internal quotation marks omitted). We are not required, however, “to accept as true allegations that are merely eoncluso-ry, unwarranted deductions of fact, or unreasonable inferences.” See Sprewell v. Golden State Warriors, 266 F.3d 979, 988 (9th Cir.2001). Nor must we “accept as true allegations that contradict matters properly subject to judicial notice or by exhibit.” Id. These principles guide our de novo review of the district court’s dismissal of Veney’s complaint.
III.
The Equal Protection Clause of the Fourteenth Amendment provides that “[n]o State shall ... deny to any person within its jurisdiction the equal protection of the laws.” U.S. Const, amend. XIV, § 1. The equal protection requirement “does not take from the States all power of classification,” Personnel Adm’r v. Feeney, 442 U.S. 256, 271, 99 S.Ct. 2282, 60 L.Ed.2d 870 (1979), but “keeps governmental decisionmakers from treating differently persons who are in all relevant respects alike.” Nordlinger v. Hahn, 505 U.S. 1, 10, 112 S.Ct. 2326, 120 L.Ed.2d 1 (1992). To succeed on an equal protection claim, Veney “must first demonstrate that he has been treated differently from others with whom he is similarly situated and that the unequal treatment was the result of intentional or purposeful discrimination.” Morrison v. Garraghty, 239 F.3d *731648, 654 (4th Cir.2001). If he makes this showing, “the court proceeds to determine whether the disparity in treatment can be justified under the requisite level of scrutiny.” Id. To state an equal protection claim, Veney must plead sufficient facts to satisfy each requirement, which we discuss in turn.
A.
Veney claims that he is not allowed to occupy a double-occupancy cell because he is a homosexual male. He asserts that both heterosexual males and homosexual females at Riverside are housed in double-occupancy cells, while his requests to move from his single-occupancy cell have been consistently denied. Veney further alleges that requests to move into a double-occupancy cell made by “seemingly heterosexual” males were granted. (J.A. at 6.) For purposes of this appeal, we must accept Veney’s allegations as true and draw all inferences in his favor. We therefore assume that Veney is not allowed to move into a double-occupancy cell because he is a homosexual male.1 We also assume, without deciding, that in all relevant respects, Veney is similarly situated to the other inmates at Riverside.2 Veney’s complaint therefore sufficiently alleges that Riverside is intentionally discriminating against him by treating him differently from similarly situated heterosexual males and homosexual females.3
B.
Having determined that Veney’s complaint alleges disparate treatment based upon intentional discrimination, we turn to our second inquiry of whether Veney has alleged facts that, if found to be true, would demonstrate that the disparate treatment lacks justification under the requisite level of scrutiny. Ordinarily, when a state regulation or policy is challenged under the Equal Protection Clause, unless it involves a fundamental right or a suspect class, it is presumed to be valid and will be sustained “if there is a rational relationship between the disparity of treatment and some legitimate governmental purpose.” Heller v. Doe, 509 U.S. 312, 319-320, 113 S.Ct. 2637, 125 L.Ed.2d 257 (1993). Veney’s case does not involve a fundamental right, and he does not allege that he is a member of a suspect class.4 Rather, he claims that he has been *732discriminated against on the basis of sexual preference and gender. • Outside the prison context, the former is subject to rational basis review, see Romer v. Evans, 517 U.S. 620, 631-32, 116 S.Ct. 1620, 134 L.Ed.2d 855 (1996) (applying the rational relation test to an amendment to Colorado’s constitution that prohibited any measures to protect homosexuals as a class), whereas the latter is subject to an intermediate level of scrutiny, see Craig v. Boren, 429 U.S. 190, 197, 97 S.Ct. 451, 50 L.Ed.2d 397 (1976) (“To withstand constitutional challenge, previous cases establish that classifications by gender must serve important governmental objectives and must be substantially related to achievement of those objectives.”). When equal protection challenges arise in a prison context, however, courts must adjust the level of scrutiny to ensure that prison officials are afforded the necessary discretion to operate their facilities in a safe and secure manner. See Morrison, 239 F.3d at 654-55. In a prison context, therefore, we must determine whether the disparate treatment is “reasonably related to [any] legitimate penological interests.” Shaw v. Murphy, 532 U.S. 223, 225, 121 S.Ct. 1475, 149 L.Ed.2d 420 (2001). We apply this deferential standard “even when the alleged infringed constitutional right would otherwise warrant higher scrutiny;” however, this more deferential review does not make us ignorant to the concerns that justify application of a heightened standard outside of the prison context. Morrison, 239 F.3d at 655, 656. Accordingly, to state a claim upon which relief may be granted, Veney must allege facts sufficient to overcome the presumption of reasonableness applied to prison policies.
As we noted in Morrison, to evaluate the reasonableness of Riverside’s policy, we apply the factors set forth in Turner v. Safley, 482 U.S. 78, 89-90, 107 S.Ct. 2254, 96 L.Ed.2d 64 (1987). Three of the four factors are relevant to Veney’s equal protection claim. Cf. Washington v. Harper, 494 U.S. 210, 224-25, 110 S.Ct. 1028, 108 L.Ed.2d 178 (1990) (applying three of the four Turner factors to a substantive due process claim).- “First, there must be a ‘valid, rational connection’ between the prison regulation and the legitimate governmental interest put forward to justify it.” Turner, 482 U.S. at 89, 107 S.Ct. 2254. Second, a court must consider “the impact accommodation of the asserted constitutional right will have on guards and other inmates, and on the allocation of prison resources generally.” Id. at 90, 107 S.Ct. 2254. Third, “the absence of ready alternatives is evidence of the reasonableness of a prison regulation.”5 Id. at 90-91, 107 S.Ct. 2254 (“This is not a ‘least restrictive alternative’ test: prison officials need not set up and then shoot down every conceivable alternative method of accommodating the claimant’s constitutional complaint.”).
1.
Veney argues that “[t]here is no legitimate penological interest for the segregation of homosexual, male inmates.” (Appellant’s Br. at 22.) We disagree. Prison safety and security are legitimate penological interests that we must consider. See Washington, 494 U.S. at 223, 110 S.Ct. 1028 (“The legitimacy, and the necessity, of considering the State’s interests in prison safety and security are well established by our cases.”). Thus, applying the Turner factors, we must first determine *733whether there is a valid, rational connection between safety and security and housing homosexual males in single-occupancy cells. Turner, 482 U.S. at 89, 107 S.Ct. 2254. In conducting this inquiry, we note that decisions relating to the accommodation of inmates, such as cell assignments, are the type of day-to-day judgments that rest firmly in the discretion of prison officials. See Pitts v. Thornburgh, 866 F.2d 1450, 1453-54 (D.C.Cir.1989) (distinguishing between “cases involving regulations that govern the day-to-day operation of prisons” and those that involve “general budgetary and policy choices made over decades in the give and take of city politics,” and concluding that the former is entitled to significantly more deference than the latter). Second-guessing such judgments “would seriously hamper [the prison officials’] ability to anticipate security problems and to adopt innovative solutions to the intractable problems of prison administration.”6 Turner, 482 U.S. at 89, 107 S.Ct. 2254.
With this deference in mind, we recognize that there are many valid reasons that support the prison officials’ conclusion that homosexuals should not be assigned to double-occupancy cells. For example, housing homosexuals with other homosexuals could lead to sexual activity between cellmates, which, as counsel for Appellees pointed out at oral argument, would jeopardize prison security. Sexual activity between cellmates also raises concerns about the transmission of diseases, such as HIV. Similarly, housing homosexuals with heterosexuals might cause friction between cellmates that potentially could lead to violence. In light of examples of anti-homosexual violence in our society, we cannot ignore the fact that homosexuals are subject to bias-motivated attacks from heterosexuals.7 See Dickerson v. United States, 530 U.S. 428, 443, 120 S.Ct. 2326, 147 L.Ed.2d 405 (2000) (noting that aspects of national culture are relevant in constitutional analysis). Outside of the prison environment, concerns of bias-motivated attacks on homosexuals have prompted almost half of the states to protect homosexuals with hate crime statutes. See, e.g., Fla. Stat. ch. 775.085 (2001) (increasing penalty for crimes that evidence prejudice based on, among other characteristics, sexual orientation); Ky. Rev.Stat. Ann. § 532.031 (Baldwin 2001) (defining hate crimes to include offenses motivated by sexual orientation); see also State Hate Crimes/Statutory Provisions at http://www.adl.org/99hatecrime/ provisions.html (2001). Studies also have shown that inmates known to be homosexuals are at a greater risk of being sexually attacked in prison. See Robert Dumond, Inmate Sexual Assault: The Plague that Persists, 80 Prison J. 407, 408 (2000) (listing homosexuals as a group that appears to be more vulnerable to sexual victimiza*734tion). Thus, in the prison environment, where inmates live in close quarters and their movements are restricted, prison officials reasonably may conclude that more proactive measures are required to protect homosexuals from bias-motivated attacks. Not allowing heterosexuals to share cells with homosexuals is a rational means- of preventing violence between the groups. Moreover, not allowing homosexuals to share cells with other homosexuals is a rational means of preventing sexual activity and the spread of sexually transmitted diseases. The authorities at Riverside are, therefore, not constitutionally precluded from limiting homosexuals to single-occupancy cells.
This does not end our inquiry, however, because Veney alleges that Riverside discriminates against him not only because he is a homosexual, but also because he is a male. We must, therefore, consider whether the gender-based dimension of the alleged discrimination is rationally connected to safety and security concerns in the prison, while again keeping in mind the deferential standard applicable to decisions regarding day-to-day prison management, see supra, at 731-32.
At Riverside, females and males are housed separately, and each gender faces unique safety and security concerns of various degrees. Indeed, it is a well-documented reality that institutions for females generally are much less violent than those for males. See, e.g., Kimberly R. Greer, The Changing Nature of Interpersonal Relationship in a Women’s Prison, 80 Prison J. 442, 462 (2000); Klinger v. Dep’t of Corr., 31 F.3d 727, 732 (8th Cir.1994) (“Male inmates ... are more likely to be violent and predatory than female inmates.”). Moreover, studies show that male inmates are more likely than female inmates to have homophobic attitudes. See Christopher Hensley, Attitudes Toward Homosexuality in a Male and Female Prison, 80 Prison J. 434, 440 (2000) (“[L]ike societal attitudes, women are less homophobic even while incarcerated.”). Insofar as homophobic attitudes lead to bias-motivated attacks, see supra, at 733-34, and males are more likely to have such attitudes than are females, prison officials would be justified in concluding that male inmates present a greater threat than female inmates of initiating such attacks. In formulating and executing decisions relating to cell assignments, we must allow prison authorities the discretion to take into account the particular safety and security concerns facing male inmates, even though such considerations result in disparate treatment based upon gender. Accordingly, because the safety and security concerns that arise from housing homosexuals in double-occupancy cells are more significant with respect to males than they are with respect to females, we conclude that the complained of gender-related disparate treatment in the housing of homosexuals is rationally calibrated to address legitimate penological concerns.8
2.
The second Turner factor we must consider is the impact of accommodating the asserted constitutional right. *735Accommodating homosexual males in double-occupancy cells would require prison officials to devote more time to making cell assignments because they would have to ensure that homosexuals were not housed with other homosexuals or with violent homophobic inmates. Furthermore, the sexual tension caused by such a living arrangement would place a greater burden on guards who would have to prevent and control disturbances between homosexual and heterosexual cellmates.
3.
The third Turner factor informs us that “the absence of ready alternatives is evidence of the reasonableness of a prison regulation.” Id. at 90. Because part of the friction that Riverside aims to prevent results from homosexual males and heterosexual males living together, there is no ready alternative to the prison’s policy of not letting members of these two groups live in the same cell. We conclude, therefore, that the prison policy of not letting homosexual males live in double-occupancy cells is reasonably justified by a legitimate penological interest. Because Veney has not alleged facts that, if proven true, would demonstrate that the alleged prison policy at issue is not reasonably related to legitimate penological interests, his complaint fails to state a claim upon which relief may be granted.
IV.
Because the disparate treatment alleged by Veney is justified by legitimate peno-logical interests, he would not be entitled to relief even if all of his allegations were true. Accordingly, we affirm the district court’s dismissal under § 1915A.
AFFIRMED.