Most likely the code share flight is booking you into a higher fare bucket than the non code share because the lower bucket is likely sold out for the code share segment(s). This is a system flaw...UA & CO's reservations systems are still separate and code share inventory is not as dynamic as it should be.