U.S. Steel Corp. joined other major steel firms yesterday in reporting improved second-quarter and first-half earnings.

The nation's largest steel producer also said its steel shipments reached their highest levels since the third quarter of 1974.

U.S. Steel earned $145.4 million ($1.69 a share) on sales of $3.6 billion in the second quarter. During the same period in 1978, earnings were $117.3 million ($1.38) on sales of $2.9 billion.

For the half, U.S. Steel earned $187.4 million ($2.19) on $6.7 billion in sales versus $58.6 million (69 cents) on $5.3 billion in sales in 1978.

The company also declared its regular quarterly dividend of 40 cents a share.

Chairman David M. Roderick noted that U.S. Steel has had five consecutive quarters in which income inporved over the previous year, but he said returns on sales and equity still are below averages reached by all manufacturing industries.

"Despite significantly higher volumes in most of our lines of business, the high rate of inflation continues to affect results reported by the corporation," Roderick said. Higher labor and energy costs "continue to erode cost-price relationships," he added.

Steel product shipments for the second quarter were 6 million tons compared with 5.4 million tons last year. For the first six months, shipments were 11.5 million tons compared with 10.4 million in the same period of 1978.

Roderick said U.S. Steel was concerned, however, about shipment levels in the fourth quarter "as the steel order rate has fallen off with no immediate signs of an upturn."

Borden Inc., a diary, food and chemical combine, had lower earnings in the second quarter on higher sales primarily because of high short-term interest rates.

Operating profit before interest charges was level with last year but net income fell 10.1 percent to $36.17 million ($1.16 a share) from $40.24 million ($1.29) a year earlier. Sales rose from $1.02 billion to $1.12 billion.

First-half profit was $64.43 million ($2.08) on sales of $2.07 billion compared with $67.9 million ($2.18) a year ago on sales of $1.86 billion.

Chairman Augustine R. Marusi said the net interest cost rise was 35 percent, or $3.7 million in the quarter. Marusi said gains in the dairy and chemical divisions offset softness in the food division's results and in international operations.

Although the gasoline shortage has reduced travel, Ramada Inns Inc. says its second-quarter profits rose 138 percent to $5.17 million (19 cents a share) from $2.2 million (9 cents) in the second quarter of 1978. Revenues for this year's second quarter were $93.1 million compared with $81 million a year earlier.

Greyhound Corp. second-quarter earnings were 78 percent higher than those for the same period a year ago, and were the highest paid for any period in the companyhs history.

Gerald H. Trautman, chairman of the Phoenix-based company, said net income for the quarter totaled $35.1 million (79 cents a share). Net income for the same period in 1978 was $19.7 million (45 cents).

"In our bus operations, we experienced a strong surge in new passenger traffic in the second quarter, resulting from the energy uncertainty," he said in a prepared statement.

Trautman said revenues for the quarter totaled $1.2 billion, compared with $1.1 billion for the corresponding period a year ago.

At the same time, he said net income for the first six months of 1979 totaled $44.6 million ($1.01) a gain of 65 percent over the $27 million (62 cents) in the 1978 first half.

According to Trautman, the increase in second-quarter earnings was due to a strong showing by virtually every Greyhound company. Although Greyhound normally doesn't break out group results on a quarterly basis, Trautman said he made certain exceptions this time.

Trautman said the new passenger business also brought consequent increases in operating costs. "On a year-to date basis, U.S. inter-city passenger operations, which include package express and charter, are still in the red," he said.

Trautman said Greyhound's Transportation Group - which comprises airport, sightseeing and Canadian regular-route and charter services, in addition to intercity passenger operations in the United States - had net income of $9.5 million in the second quarter compared with $5.2 million last year.