I wouldn't call 35000 troops of mostly non-combat specializations a "huge number". In the Cold War, the American presence in West Germany was an order of magnitude larger, about quarter a million soldiers.
"Defence, or occupation?"
Neither/nor. Logistics for various distant operations. Rhineland is a very practical stop located between the US and the Middle East + North Africa (MENA), closer to MENA, with highly developed maintenance and repair facilities, communication facilities, top-notch hospitals for casualties etc.
If a GI Joe gets seriously injured in Kabul or Baghdad or now possibly Tehran, they are airlifted to Ramstein. If an armored vehicle gets damaged by a roadside bomb and the local mechanics cannot fix it on the spot, dtto.
General Hodges wrote several articles on how dumb the current administration is to alienate Europe, because without access to such facilities, any deployment in the wider region becomes very challenging. Even the original invasion of Iraq was somewhat complicated by the Irish refusing the use of Shannon airport for US military aircraft.