<PAGE>

                      [LOCKE LIDDELL & SAPP LLP LETTERHEAD]


                                                                     EXHIBIT 5.1

                                January 18, 2002


Cornell Companies, Inc.
1700 West Loop South, Suite 1500
Houston, Texas   77027

Gentlemen:

      We have acted as counsel for Cornell Companies, Inc., a Delaware
corporation (the "Company"), in connection with the registration, pursuant to a
Registration Statement on Form S-8 being filed with the Securities and Exchange
Commission (the "Registration Statement") under the Securities Act of 1933, as
amended, of the offering of up to 432,119 additional shares of the Company's
common stock, par value $.001 per share (the "Common Stock"), which may be
issued under the Cornell Companies, Inc. Amended and Restated 1996 Stock Option
Plan (the "1996 Plan") and 115,232 additional shares of Common Stock, which may
be issued under the Cornell Companies, Inc. 2000 Broad-Based Employee Plan (the
"2000 Plan").

      In such capacity, we have examined the corporate documents of the Company,
including its Restated Certificate of Incorporation and its Amended and Restated
Bylaws, each as amended, and resolutions adopted by its board of directors and
committees thereof. We have also examined the Registration Statement, together
with the exhibits thereto, and such other documents which we have deemed
necessary for the purposes of expressing the opinion contained herein. We have
relied on representations made by and certificates of the officers of the
Company and public officials with respect to certain facts material to our
opinion. We have made no independent investigation regarding such
representations and certificates.

      Based upon the foregoing, we are of the opinion that the shares of Common
Stock issued pursuant to the 1996 Plan and the 2000 Plan will be validly issued,
fully paid and nonassessable.

      We hereby consent to the filing of this opinion as an exhibit to the
Registration Statement.

                                          Very truly yours,

                                          LOCKE LIDDELL & SAPP LLP


                                          /s/ DAVID F. TAYLOR
                                          ------------------------------------
                                          David F. Taylor

