The target lift-to-drag ratio (L/D) also plays an important role. A high L/D provides greater aerodynamic control authority during hypersonic entry, providing engineers with greater flexibility in terms of controlling the maximum heating rate and maximum g-load, as well as achieving cross range and targeting objectives. Early in the Apollo Program, the capsule designers were targeting L/D ratios as high as 0.5, which requires a significant angle of attack. Thus the sidewall angle of the Apollo capsule was set at roughly 32.5 degrees to minimize direct flow impingement and the associated heating effects on the sidewall, which would impact the thermal protection system (TPS) design and materials. As the Apollo capsule design evolved, engineers found it difficult to achieve the target L/D because it requires a substantial offset to the center of gravity (cg) to achieve the required angle of attack (AoA). In addition, a low cg (closer to the base heat shield) improves aerodynamic stability, but a greater lateral offset is required to achieve the same AoA. This conflicts with the fact that, as designers pack more and more equipment into a capsule, the cg tends to converge toward the centerline. Ballast can be used to influence the cg location, but every extra kilogram in the Apollo capsule flowed through and impacted the mass of the Service Module and the ability of the Saturn V rocket to inject the CSM into the trans-lunar trajectory. In the end, the capsule design represents a compromise across many factors including internal volume/dimensions, ballistic coefficient, L/D, TPS materials and thicknesses, etc. The Apollo capsule ended up flying at a L/D of ~0.32.
The Soyuz capsule, in contrast, has a very shallow sidewall (I seem to recall a value of 7.5 degrees). Its more cylindrical shape provides greater volume for a given base diameter. But it is also flown at a lower angle of attack, achieving an L/D in the range of 0.18 or so. The Soyuz capsule provides excellent stability, but pulls fairly high g-loads and has limited control. But it is a very efficient design, as well, and has proven itself over a large number of missions.
This is a very brief and simplistic treatment of the topic. As noted in other posts, the launch environment and abort scenarios introduce their own design influences to a crew capsule, as does the landing scenario (e.g., land versus water). If you enjoy this type of intellectual exercise, then you might want to consider a career in aerospace engineering.