Several prerequisites:
Is the wheel true and dished? Check for true on a bike frame with brakes and check for dish with a dish guage.
Does your frame have horizontal or vertical dropouts? If horizontal, does it have adjuster screws? Are they adjusted so the plane of the wheel is at least parallel to the plane of the main triangle? The ends of the rear axle need to be equidistant from the BB axis, for the wheel to spin in or at least parallel to the plane of the main triangle.