(I'm interpreting the question as "what programming language was the first spacecraft software written in?", per discussion in comments above.)
This will depend on your definitions of "computer" and "programming language". Almost certainly the first digital computers on spacecraft were programmed in assembly language or microcode. You can get a lot of historical detail from Computers In Spaceflight: The NASA Experience.
Adoption of high-level languages happened much later in spacecraft than on the ground because, typically, assembly language is more efficient (so you can do equivalent work on a lighter, less power-hungry, and/or more radiation-hardened CPU), and gives finer-grained control to the programmer (thus less likely to produce unexpected results).
The earliest digital computer on a spacecraft I can find is Ranger 3, 1962:
Spacecraft control was provided by a solid-state computer and sequencer and an earth-controlled command system.
"Sequencer" suggests it was programmed via physical switches and/or hard-wired microcode at a quite low level, but I haven't found any real details on the computer itself.
Gemini was the first manned US spacecraft to carry a digital computer, starting with Gemini 3 in 1965.
"The computer weighed approximately 59 pounds, performed more than 7,000 calculations a second, and needed no more room than a hatbox — 1.35 cubic feet — aboard the Gemini. It had an average power consumption of 94.54 watts, a 500 kc bit rate, a memory cycle time of 250 kc and an add time of 140 microseconds. The computer's memory was a random-access, nondestructive readout design with flexible instruction and data storage organization. Its nominal capacity was 4,096 39-bit words and its operational capacity was 12,288 13-bit words." (IBM's historical archives).
This almost certainly was programmed in assembly language rather than a high-level language.
The Galileo spacecraft flown in 1989 appears to be the first US unmanned spacecraft flying software written in a high-level language:
JPL carefully explored memory requirements and software development prospects. Prototype programs were written in HAL/S and FORTRAN for the command computer and the attitude control computer. Ideas for the content of the programs came from Voyager experience and the executive written for the NSSC-1. The project office originally specified that HAL would be used for programming all flight software. When irreducible inefficiencies appeared in the compiler bought for the command and data computers, HAL was abandoned for that system and replaced with "structured macros". HAL was retained for the other computer system. Although most microprocessors in the scientific experiments are coded in assembler, one is programmed in FORTH, so high-level languages finally appeared on unmanned spacecraft.
The USSR's first digital computer in space was the Argon 11c aboard an unmanned Zond series spacecraft in 1964. I assume it was programmed in assembly language rather than a high level language.
Number representation - fixed point. Word length - 14 bits, command length - 17 bits. Number of instructions - 15.
Execution times: addition - 30 ms, multiplication - 160 ms.
RAM capacity - 128 14-bit words, ROM capacity - 4,096 17-bit words.
The early Soyuz spacecraft lacked digital computers; the Soyuz-T in 1980 appears to have been their first manned spacecraft controlled by an onboard digital computer, Argon-16.
Representation of numbers - fixed point. Word length: 16 bits (word), 32 bits (double word); instruction length - 16 bits. Number of instructions - 32.
Speed: addition - 5 ms, multiplication - 45 ms.
RAM capacity: 3 x 2 Kbytes, ROM capacity - 3 x 16 Kbytes.
I would guess this was also assembly-programmed, though with the larger ROM and later date, a high-level language wouldn't have been out of the question.
The first high-level language on a spacecraft that I know of would be the space shuttle's HAL/S, first "delivered" in 1973 and first flown sometime between 1977 and 1981.