Acts 2:38 Peter said to them, "Repent, and each of you be baptized in the name of Jesus Christ for the forgiveness of your sins; and you will receive the gift of the Holy Spirit" (Acts 2:38, NASB).

1. Only certain Jews during this transitional time period were told to be water baptized in the name of the Lord for the forgiveness of sins because they delivered (paradidwmi) Christ up to Pilate (John 18:35) which constituted "the greater sin" (John 19:11). Peter would later tell the Jews in his audience they delivered (paradidwmi) Him up to Pilate (Acts 3:13 cf. Acts 3:17). Compared with all other people these Jews were not strangers to the covenants of promise (Ephesians 2:12) which testified of Christ (John 5:39). They saw many of His miracles and heard many of His words. Their greater sin required a greater form of repentance – water baptism in the Name of their Messiah whom they crucified (See William Murk’s “Four Kinds of Water Baptism”).
2. Thiele: In the report of the trial before Pilate into which are interwoven many legal ideas Pilate pronounces his repeated conclusion that he can find no guilt in Jesus deserving death (in Jn. 18:38; 19:4, 6, aitia; in Lk. 23:4, 14, 22, aition). Hence in the Gospel accounts the demand of the crowd for the death of the innocent one is all the more culpable (NIDNTT 2:139, Guilt).
3. No clear cut case exists in Scripture of any Gentile being water baptized in the name of the Lord for the forgiveness of sins. Since Cornelius and the Gentiles with him received the Holy Spirit before they were water baptized this proves they were saved before they were water baptized (Romans 8:9; 1 John 4:13; etc.)
4. Murray Harris: Liddel-Scott list no casual uses of eis (NIDNTT 3:1187, Appendix D3).
5. Murray Harris: It is significant that A. Oepke, who notes an occasional casual eis in the NT, finds eis to be final in both Matt. 3:11 and Acts 2:38 (eis, TDNT 2:429) (NIDNTT 3:1209, Appendix A Prepositions with baptizw 3. eis)
6. Danker: to denote purpose in order to, to
for forgiveness of sins, so that sins might be forgiven Mt 26:28 cp. Mk 1:4; Lk 3:3; Ac 2:38 (A Greek-English Lexicon of the New Testament and Other Early Christian Literature, eis, page 290).
Water baptism is not because of their sins were forgiven but done in order to attain the forgiveness of sins. Christ's blood was poured out not because sins were already forgiven but done in order to attain the forgiveness of (our) sins as well.
for this is My blood of the covenant, which is poured out for many for forgiveness of sins (Matthew 26:28, NASB).
for the forgiveness of your sins (Acts 2:38, NASB).
εἰς ἄφεσιν ἁμαρτιῶν (Matthew 26:28) = εἰς ἄφεσιν τῶν ἁμαρτιῶν (Acts 2:38)
7. G.R. Beasley-Murray: Luke's understanding of Christian baptism appears in Acts 2:38. Baptism is conversion-baptism; it is administered "in the name of Jesus Christ", i.e. in relation to Jesus Christ and with the use of his name, so that the baptized calls on the name of the Christ (Acts 22:16) even as the name is called over him, signifying to whom he belongs (cf. Jas. 2:7); it is "for the forgiveness of sins" and with a view to the gift of the Holy Spirit (NIDNTT 1:146, Baptism).
8. G.R. Beasley-Murray: Whatever the relationship between baptism and the gift of the Spirit elsewhere in Acts, there appears to be no doubt as to the intention of Acts 2:38; the penitent believer baptized in the name of Jesus Christ may expect to receive at once the Holy Spirit, even as he is assured the immediate forgiveness of his sins (Baptism in the New Testament, G.R. Beasley-Murray, page 108).